apache php mysql tomcat 연동 설치

# 설치된 OS
# CentOS 7

# 설치전 필요 패키지 설치
# yum -y install gcc g++ cpp gcc-c++ zlib* curl* openssl openssl-devel ncurses-devel zip2-devel libtermcap-devel libc-client-devel perl bison make cmake db4-devel libvpx-devel wget

# 설치전 패키지 업데이트
# yum -y update

# 소스파일 다운로드 위치로 이동
# cd /usr/local/temp

# APR download 및 압축해제, 아래 URL에 없으면 구글 검색 후 URL 변경
# wget http://apache.tt.co.kr//apr/apr-1.5.1.tar.gz
# wget http://apache.tt.co.kr//apr/apr-util-1.5.4.tar.gz
# tar zxvf apr-1.5.1.tar.gz
# tar zxvf apr-util-1.5.3.tar.gz
# APR 폴더로 이동 및 configure, make, make install
# cd apr-1.5.1
# ./configure –prefix=/usr/local/apr
# make; make install
# APR-UTIL 폴더로 이동 및 configure, make, make install
# cd apr-util-1.5.3
# ./configure –with-apr=/usr/local/apr –with-iconv=/usr/local/lib
# make; make install
# apache download 및 압축해제
# wget http://apache.tt.co.kr//httpd/httpd-2.4.10.tar.gz
# tar zxvf httpd-2.4.10.tar.gz
# openssl설치
# wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
# tar -zxvf openssl-1.0.1g.tar.gz
# cd openssl-1.0.1g
# ./config –prefix=/usr/local/openssl-1.0.1g –openssldir=/usr/local/openssl-1.0.1g -fPIC no-gost no-shared no-zlib
# make depend
# make
# make test
# make install
# apache configure
# ./configure \
–prefix=/usr/local/httpd-2.4.10 \
–enable-mods-shared=most \
–enable-mules=so \
–enable-modules=shared \
–enable-rewrite \
–enable-ssl \
–with-mpm=worker \
–with-ssl=/usr/local/openssl-1.0.1g
# mysql 설치 – 참고 http://mindit.co.kr/109
# 기 설치된 mysql 제거
# yum remove mysql
# wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.20.tar.gz
# tar zxvf mysql-5.6.20.tar.gz
# cd mysql-5.6.20
# cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.6.20 \
-DMYSQL_UNIX_ADDR=/usr/local/mysql-5.6.20/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DMYSQL_DATADIR=/var/mysql/data/ \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DWITH_INNODB_MEMCACHED=ON \
-DENABLE_DOWNLOADS=1
# make; make install
# mysql 데이터베이스 생성 – 사용자 계정경로(홈디렉토리) 없이 생성
# useradd –M mysql 
# chown -R mysql.mysql mysql-5.6.20
# /usr/local/mysql-5.6.20/scripts/mysql_install_db \
–defaults-file=/usr/local/mysql-5.6.20/my.cnf \
–user=mysql \
–basedir=/usr/local/mysql-5.6.20 \
–datadir=/var/mysql/data \
–explicit_defaults_for_timestamp=on
# mysql 설정
# cp /usr/local/mysql-5.6.20/support-files/mysql.server /etc/init.d/mysqld
# vi /etc/init.d/mysqld
basedir=/usr/local/mysql-5.6.20
datadir=/var/mysql/data
# mysql 서비스 등록
# chmod 755 /etc/init.d/mysqld
# chkconfig –add mysqld
# chkconfig –list mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# mysql 실행
# service mysqld start
Starting MySQL. [ OK ]
# mysql 환경설정
# vi /etc/profile
export PATH=$PATH:/usr/local/mysql-5.6.20/bin
# vi /etc/ld.so.conf
/usr/local/mysql-5.6.20/lib
# source /etc/profie
# ldconfig
# mysql 비밀번호 설정
# mysql
mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘패스워드’);
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
# mysql -uroot -p
Enter password:.
# yum으로 설치된 php삭제
# yum remove php
# yum list php-common
# libjpeg 설치
# 소스 홈페이지 http://www.ijg.org/
# wget http://www.ijg.org/files/jpegsrc.v9a.tar.gz
# tar zxvf jpegsrc.v9a.tar.gz
# cd jpeg-9a/
# ./configure –prefix=/usr/local/lib/jpeglib –enable-shared –enable-static
# make; make install
# libpng 설치 – 소스 홈페이지 http://libpng.org/
# wget http://sourceforge.net/projects/libpng/files/libpng16/1.6.13/libpng-1.6.13.tar.gz
# tar zxvf libpng-1.6.13.tar.gz
# cd libpng-1.6.13
# ./configure –prefix=/usr/local/lib/libpng
# make; make install
# freetype 설치 – 소스 홈페이지 http://freetype.org/
# freetype sourceforge.net 홈페이지 소스보기해서 tar.gz 파일 링크를 알아낸다음 wget을 이용해서 다운로드 하였음
# wget http://sourceforge.net/projects/freetype/files/freetype2/2.5.3/freetype-2.5.3.tar.gz
# tar zxvf freetype-2.5.3.tar.gz
# cd freetype-2.5.3
# ./configure –prefix=/usr/local/lib/freetype
# make; make install
# php 설치
download php-5.6.0.tar.gz
# ./configure –prefix=/usr/local/php-5.6.0 \
–with-apxs2=/usr/local/httpd/bin/apxs \
–with-config-file-path=/usr/local/httpd/conf \
–with-mysql=/usr/local/mysql \
–with-mysql-sock=/usr/local/mysql \
–with-mysqli=/usr/local/mysql/bin/mysql_config \
–with-pdo-mysql=shared,/usr/local/mysql \
–with-libxml-dir=/usr/local/lib/libxml2 \
–with-db4=/usr \
–with-pcre-dir=/usr \
–with-openssl-dir=/usr/local/openssl-1.0.1g \
–with-vpx-dir=/usr \
–with-jpeg-dir=/usr/local/lib/jpeglib \
–with-png-dir=/usr/local/lib/libpng \
–with-zlib-dir=/usr \
–with-xpm-dir=/usr \
–with-freetype-dir=/usr/local/lib/freetype \
–with-libexpat-dir=/usr \
–with-t1lib=/usr \
–with-icu-dir=/usr \
–with-openssl –with-pcre-regex –with-zlib –with-bz2 –with-curl –with-gdbm \
–with-gd –with-xmlrpc –with-xsl –with-dbm –with-regex=php \
–with-gettext –with-gmp –with-mhash –with-imap –with-imap-ssl \
–with-kerberos –with-ldap –with-ldap-sasl –with-libmbfl –with-onig \
–with-mcrypt –with-libedit –with-readline –with-tidy –with-libdir=lib64 \
–enable-bcmath –enable-calendar –enable-exif –enable-ftp \
–enable-pcntl –enable-gd-native-ttf –enable-gd-jis-conv \
–enable-intl –enable-mbstring –enable-shmop –enable-sockets \
–enable-sysvmsg –enable-sysvsem –enable-sysvshm –enable-wddx \
–enable-zip –enable-mysqlnd –with-pear –with-pic –enable-dba=shared \
–enable-mod-charset –enable-dom –enable-mbregex \
–enable-inline-optimization –enable-sigchild –enable-soap \
–enable-maintainer-zts –enable-opcache=no
# make; make install
# make test
# make test 결과
=====================================================================
FAILED TEST SUMMARY
———————————————————————
Bug #39322 (proc_terminate() loosing process resource) [ext/standard/tests/general_functions/bug39322.phpt]
proc_open [ext/standard/tests/general_functions/proc_open02.phpt]
Bug #61019 (Out of memory on command stream_get_contents) [ext/standard/tests/streams/bug61019.phpt]
=====================================================================

=====================================================================
WARNED TEST SUMMARY
———————————————————————
zend multibyte (2) [ext/mbstring/tests/zend_multibyte-02.phpt] (warn: XFAIL section but test passes)
zend multibyte (6) [ext/mbstring/tests/zend_multibyte-06.phpt] (warn: XFAIL section but test passes)
zend multibyte (8) [ext/mbstring/tests/zend_multibyte-08.phpt] (warn: XFAIL section but test passes)
zend multibyte (10) [ext/mbstring/tests/zend_multibyte-10.phpt] (warn: XFAIL section but test passes)
zend multibyte (11) [ext/mbstring/tests/zend_multibyte-11.phpt] (warn: XFAIL section but test passes)
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP’s behavior.
If you don’t want to send the report immediately you can choose
option “s” to save it. You can then email it to qa-reports@lists.php.net later.

# apache php 연동
작성 진행중…

# apache tomcat 연동, http://nomore7.tistory.com/6 참조
# wget http://mirror.apache-kr.org/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.40-src.tar.gz
# tar zxvf tomcat-connectors-1.2.40-src.tar.gz
# cd tomcat-connectors-1.2.40-src.tar.gz/native
# ./configure — with-apxs=/usr/local/httpd-2.4.10/bin/apxs
# make; make install
# mod_jk.so 파일이 생성되었는지 확인, 생성된 것을 확인하였으면 다음 단계 진행
# ll /usr/local/httpd-2.4.10/modules/mod_jk.so
# httpd.conf 파일 하단에 다음을 추가
# Include /usr/local/httpd-2.4.10/conf/mod_jk.conf
# 아파치홈/conf/mod_jk.conf
LoadModule jk_module modules/mod_jk.so #modules디렉토리의 mod_jk.so 모듈을 로드
JkWorkersFile “conf/workers.properties”
JkLogFile “logs/mod_jk.log” #log를 어디에 남길지 지정합니다.
JkLogLevel info
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ” #로그를 어떠한 형태로 남길지 지정합니다.
JkRequestLogFormat “%w %V %T”
JkMount /*.do worker1 #해당 확장자를 처리한 worker를 지정합니다
JkMount /*.jsp worker1 #해당 확장자를 처리한 worker를 지정합니다
JkMount /servlet/* worker1 #해당 확장자를 처리한 worker를 지정합니다
# 아파치홈/conf/ workers.properties
worker.list=worker1
worker.worker1.type=ajp13 #프로토콜
worker.worker1.host=localhost #호스트
worker.worker1.port=8009 #포트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다