apache2+php5+tomcat5를 리눅스 9.0에서 연동할 때 환경설정 때
아래는 제가 설치했던 방법을 전부 적어봤습니다.
그런데 아파치하고 톰캣하고 연동이 잘 안되네요..
아무래도 jk2.properties, worker2.properties를 잘못 구현한거 같은데 좀 봐주시기 바랍니다.
** Linux RedHat 9 **
---------- 1. APACHE 와 SSL설치----------------------------------
get httpd-2.0.52.tar.gz
get openssl-0.9.7e.tar.tar
tar -xvzf httpd-2.0.52.tar.gz
tar -xvzf openssl-0.9.7e.tar.tar
cd /usr/local/src/openssl-0.9.7e
./config
make
make install
cd /usr/local/src/httpd-2.0.52
./buildconf
./configure --prefix=/usr/local/apache2 --sysconfdir=/usr/local/apache2/conf --enable-so --enable-ssl
make
make install
/etc/httpd/conf/디렉토리 아래에서 httpd.conf, magic, Makefile을 제외한 모든 디렉토리 및 파일을 /usr/local/apache2/conf/에 복사
vi /usr/local/src/apache2/conf/httpd.conf
User apache
Group apache
vi ssl.conf
아래와 같이 주석처리
#<IfDefine SSL>
#</IfDefine SSL>
__________________________________________________________
---------- 3. PHP설치--------------------------------------
yum install python-devel
get libxml2-2.5.11-1.src.rpm
chmod 755 libxml2-2.5.11-1.src.rpm
rpm -ihv libxml2-2.5.11-1.src.rpm
cd /usr/src/redhat/SPECS/
rpmbuild -bb libxml2.spec
cd /usr/src/redhat/BUILD/libxml2-2.5.11
./configure
make
make install
get php-5.0.2.tar.tar
tar -xvzf php-5.0.2.tar.tar
cd /usr/local/src/php-5.0.2
./configure --with-apxs2=/usr/local/apache2/bin/apxs
make
make install
cp php.ini-dist /usr/local/lib/php.ini
vi /usr/local/apache2/conf/httpd.conf
AddType application/x-httpd-php .php .phtml .html .htm
AddType application/x-httpd-php-source .phps
__________________________________________________________
---------- 4. JDK설치--------------------------------------
get jdk-1_5_0-linux-i586-rpm.bin
chmod 755 jdk-1_5_0-linux-i586-rpm.bin
sh jdk-1_5_0-linux-i586-rpm.bin
rpm -ihv jdk-1_5_0-linux-i586.rpm
vi /etc/profile
JAVA_HOME=/usr/java/jdk1.5.0
CLASSPATH=.$JAVA_HOME/lib$JAVA_HOME/lib/classes.zip
PATH=$PATH$JAVA_HOME/bin
export JAVA_HOME CLASSPATH PATH
__________________________________________________________
---------- 5. ANT설치--------------------------------------
get apache-ant-1.6.2-bin.tar.gz
mv apache-ant-1.6.2-bin.tar.gz /usr/local/
cd /usr/local/
tar -xvzf apache-ant-1.6.2-bin.tar.gz
vi /etc/profile
ANT_HOME=/usr/local/apache-ant-1.6.2
PATH=$PATH$JAVA_HOME/bin$ANT_HOME/bin
export JAVA_HOME CLASSPATH PATH ANT_HOME
__________________________________________________________
---------- 5. TOMCAT설치----------------------------------
get jakarta-tomcat-5.5.4.tar.gz
mv jakarta-tomcat-5.5.4.tar.gz /usr/local/
cd /usr/local/
tar -xvzf jakarta-tomcat-5.5.4.tar.gz
cd jakarta-tomcat-5.5.4
mkdir source
cd source/
get build.xml
ant
ant checkout
ant build
cd /usr/local/jakarta-tomcat-5.5.4/source/jakarta-tomcat-5
ant
vi /etc/profile
CATALINA_HOME=/usr/local/jakarta-tomcat-5.5.4
cd $CATALINA_HOME/bin
tar -xvzf jsvc.tar.gz
cd jsvc-src
chmod 755 configure
autoconf
./configure
make
cp jsvc ..
cd $CATALINA_HOME
./jsvc -Djava.endorsed.dirs=./common/endorsed -cp ./bin/bootstrap.jar \
-outfile ./logs/catalina.out -errfile ./logs/catalina.err \
org.apache.catalina.startup.Bootstrap
__________________________________________________________
---------- 6. mod_jk2.so를 이용한 connector설치(apr, apr-util 함께 설치)
get apr-0.9.5.tar.gz
tar -xvzf apr-0.9.5.tar.gz
cd /usr/local/src/apr-0.9.5
./buildconf
./configure
make
make install
get apr-util-0.9.5.tar.gz
tar -xvzf apr-util-0.9.5.tar.gz
cd apr-util-0.9.5
./configure --with-apr=/usr/local/src/apr-0.9.5
make
make install
get jakarta-tomcat-connectors-jk2-src-current.tar.gz
tar -xvzf jakarta-tomcat-connectors-jk2-src-current.tar.gz
cd /usr/local/src/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2
./buildconf.sh
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--with-java-home=${JAVA_HOME} --with-java-platform=2 --enable-jni --with-jni
make
cd ../build/jk2/apache2
/usr/local/apache2/bin/apxs -n jk2 -i mod_jk2.so
cp -i ../build/jk2/apache2/*.so /usr/local/apache2/modules/
cd /usr/local/apache2/conf
vi httpd.conf
LoadModule jk2_module modules/mod_jk2.so
DirectoryIndex index.html index.php index.jsp
vi workers2.properties
##begin workers2.properties##
[shm]
file=/usr/local/apache2/logs/shm.file
size=1048576
[channel.socketlocalhost8009]
port=8009
host=127.0.0.1
[ajp13localhost8009]
channel=channel.socketlocalhost8009
[statusstatus]
[uri/jsp-examples/*]
worker=ajp13localhost8009
[uri/servlets-examples/*]
worker=ajp13localhost8009
[uri/tomcat-docs/*]
worker=ajp13localhost8009
[uri/*]
worker=ajp13localhost8009
[uri/status/*]
worker=statusstatus
##end of file###
cd /usr/local/jakarta-tomcat-5.5.4/conf
vi jk2.properties
##begin jk2.properties###
channelSocket.port=8019
shm.file=/usr/local/apache2/logs/jk2.shm
apr.jniModeSo=inprocess
##end of file###
vi server.xml
<!--<Connector port="8080".../>--> 태그 주석처리
주석 아래에 다음 태그 추가
<Connector className="org.apache.coyote.tomcat5.CoyoteConnector"
port="8009" minProcessors="5" maxProcessors="75" enableLookups="true"
redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000"
useURIValidationHack="false" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" />
아래 태그 주석 해제
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
아래 태그 주석처리
<!--<Engine name="Catalina" defaultHost="localhost">-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"> 태그를
<Host name="localhost" appBase="/"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"> 태그로 변경 appBase가 변경됨.
<Context path="/" docBase="/usr/local/apache2/htdocs" debug="0" /> 태그 추가
cd /usr
ln -s /usr/local/apache2/conf ./conf
__________________________________________________________
sh /usr/local/jakarta-tomcat-5.5.4/bin/startup.sh
/usr/local/apache2/bin/apachectl start
데몬 띄우고 웹브라우져에서 주소 입력해서 들어가면
internel server error가 뜨고요
에러 로그를 보면
아래와 같습니다.
[Mon Dec 20 102321 2004] [error] msgAjp.receive() Bad signature 03c
[Mon Dec 20 102321 2004] [error] channelApr.receive() Bad header
[Mon Dec 20 102321 2004] [error] workerEnv.processCallbacks() Error reading reply
[Mon Dec 20 102321 2004] [error] ajp13.service() ajpGetReply recoverable error 120000
[Mon Dec 20 102341 2004] [error] msgAjp.receive() Bad signature 03c
[Mon Dec 20 102341 2004] [error] channelApr.receive() Bad header
[Mon Dec 20 102341 2004] [error] workerEnv.processCallbacks() Error reading reply
[Mon Dec 20 102341 2004] [error] ajp13.service() ajpGetReply recoverable error 120000
[Mon Dec 20 102341 2004] [error] ajp13.service() Error forwarding ajp13localhost8009 1 0
[Mon Dec 20 102341 2004] [error] mod_jk2.handler() Error connecting to tomcat 120000, status 0
... 아직도 레드햇 9를
... 아직도 레드햇 9를 쓰신다니, 최신 배포판으로 업그레이드하시고 간편하게 설치하시기 바랍니다.
---- 절취선 ----
http://blog.peremen.name
낚이셨음...
낚이셨음...
http://star4u.org
http://mirror.star4u.org
날짜 보니 그렇네요.
날짜 보니 그렇네요. 사실 요즘에도 저런 환경 쓰는 분이 아직도 사라지지 않아서 제목만 보고 낚였습니다.
---- 절취선 ----
http://blog.peremen.name
벌써...해결
벌써 해결 했겠져....5년전 자료에 댓글을 다시면.....
설마 5년동안 해결 못하지는 안겠죠...
나는야...게으른 바보베짱이
조금만 기다리다
조금만 기다리다 Test2나 vcp training 오면 yum으로 올려야 겠군요....
라이브 CD는 좋은 선택이지요 ^^;;
댓글 달기