简体   繁体   中英

I want to integrate tomcat and apache using mod_jk for my grails application

I'd like to integrate tomcat and apache using mod_jk for my grails application. I want my static resources to be served from apache. The resources must be outside the application. I did the settings for apache like:

ProxyPass /appName ajp://localhost:8009/appName
ProxyPassReverse /appName ajp://localhost:8009/appName

Please let me know how to do this....

ProxyPass is a directive used by mod_proxy not mod_jk .

If you want to use mod_jk use:

JkMount /appName/* workerApp

For this to work you need to configure the module (/etc/apache2/mods-available/jk.load ):

LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so

JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

then add a worker ( /etc/apache2/workers.properties ):

workers.tomcat_home={PATH_TO_TOMCAT}
workers.java_home={PATH_TO_JVM}
ps=/
worker.list=workerApp
worker.workerApp.port=8009
worker.workerApp.host=localhost
worker.workerApp.type=ajp13
worker.workerApp.lbfactor=1

Be sure this line is not commented in Tomcat server.xml :

<Connector port="8009" address= "127.0.0.1" enableLookups= "false" redirectPort= "8443" protocol= "AJP/1.3" />

The Apache Tomcat Connector - Reference Guide is a good source of information for mod_jk configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM