问题
I am using Centos with Plesk 11.x and this post How to obtain Apache mod_jk connector for for RHL? helped me to install mod-jk but what's next. I mean how can I integrate it with Tomcat as installation is not enough to bring it up.
Is anybody can help me?
Regards
回答1:
After installation you need to:
- create workers.properties file
- mod-jk config file
- Changes in Catalina_Home/conf/server.xml file
- setting domain name conf/vhost.conf
- Reconfiguration of httpdmng in case of Plesk
Here how to do these:
# vi /etc/httpd/conf/workers.properties
worker.list=worker1
# Define Node1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
#vi /etc/httpd/conf.d/mod_jk.conf
<IfModule !mod_jk.c>
LoadModule jk_module "/usr/lib64/httpd/modules/mod_jk.so"
</IfModule>
JkWorkersFile "/etc/httpd/conf/workers.properties"
JkLogFile "/var/log/httpd/mod_jk.log"
JkLogLevel info
#NameVirtualHost IP:7080
<VirtualHost yourServerIP:7080>
ServerName localhost
JkMount /manager worker1
JkMount /manager/* worker1
JkMount /docs worker1
JkMount /docs/* worker1
JkMount /examples worker1
JkMount /examples/* worker1
JkMount /host-manager worker1
JkMount /host-manager/* worker1
JkMount /servlet/* worker1
JkMount /*.jsp worker1
</VirtualHost>
# vi /var/www/vhosts/system/yourDomain.com/conf/vhost.conf
JkMount /servlet/* worker1
JkMount /*.jsp worker1
Then run:
/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain yourDomain.com
mod_jk in $CATALINA_HOM/conf/ server.xml:
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
change this with:
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
Let me know if you face any problem
Regards
来源:https://stackoverflow.com/questions/33551523/centos-with-plesk11-x