2013-05-17 66 views

回答

7

安裝modjk:

sudo apt-get install libapache2-mod-jk 
sudo a2enmod jk 

創建workers.properties文件:

worker.list=tomcat,tstatus 
worker.tomcat.type=ajp13 
worker.tomcat.host=[TOMCAT-IP HERE] 
worker.tomcat.port=[TOMCAT-AJP-PORT HERE] 
#status information (optional) 
worker.tstatus.type=status 

這個添加到httpd.conf文件:

JkWorkersFile /PATH-TO-YOUR-FILE/workers.properties 
JkLogFile  /var/log/apache2/mod_jk.log 
JkShmFile  /tmp/jk-runtime-status 
JkLogLevel  info 

JkMount /YourJavaAppName  tomcat 
JkMount /YourJavaAppName/*  tomcat 

JkMount /modjkstatus tstatus 

現在,你應該能夠訪問:

http://YOUR-IP/wordpress 
http://YOUR-IP/YourJavaAppName (redirected) 
http://YOUR-IP/modjkstatus (redirected) 
+0

感謝您的回答 –

2

這些步驟在RHEL/Centos的安裝它,其他的事情保持相同的距離斯特凡的答案

#Install httpd 
sudo yum install httpd 
#Check if the httpd -l command has mod_so.jk. 

sudo yum install httpd-devel 
sudo yum install gcc 
sudo yum install libtool 

wget http://supergsego.com/apache/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.41-src.tar.gz 

tar -xvf tomcat-connectors-1.2.41-src.tar.gz 
cd tomcat-connectors-1.2.41-src 
cd native 

./configure -with-apxs=/usr/sbin/apxs 
make 

#Now use libtool to move the mod_jk.so to /etc/httpd/modules 
#You are probably good to go now. 
+0

但請考慮mod_proxy被認爲比mod_jk更現代。在日期的Jetty版本甚至不支持mod_jk。我自己已經遷移到了mod_proxy和Jetty設置。 – premganz

+0

使用httpd-devel軟件包修改小寫錯誤 –

相關問題