Yes. Apache connect with tomcat and jetty together. I have succeeded in either of them(apache + tomcat and apache + jetty). But when together, no ideas.
Belowed is the part added in httpd.conf in tomcat
# Load mod_jk module
LoadModule jk_module "C:\Program Files (x86)\Apache Group\Apache24\manual\mod_jk.so"
# Where to find workers.properties
JkWorkersFile "C:/Program Files (x86)/Apache Group/Apache24/conf/workers.properties"
# Where to put jk logs
JkLogFile "C:/Program Files (x86)/apache-tomcat-7.0.54/logs/mod_jk.log"
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send servlet for context /examples to worker named ajp13
#JkMount /servlet/* ajp13
# Send JSPs for context /examples to worker named ajp13
JkMount /*.jsp ajp13
JkMount /*.jspa ajp13
JkMount /*.jspx ajp13
JkMount /*.do ajp13
JkMount /*.htm ajp13
Alias /rest "C:/www/projectB"
<Directory "C:/www">
Options Indexes FollowSymLinks
allow from all
</Directory>
Alias /wisemapping "C:\Users\projectA"
<VirtualHost *:80>
ServerName localhost
ServerAdmin localhost
JkMount /* jetty
</VirtualHost>
Then work.propertis :
workers.tomcat_home="C:\Program Files (x86)\apache-tomcat-7.0.54"
workers.java_home="C:\Program Files\Java\jdk
1.7.0_55"
worker.list=ajp13
worker.ajp13.port=8009 #TOMCAT
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.list=jetty
worker.jetty.port=8007 #JETTY
worker.jetty.host=localhost
worker.jetty.type=ajp13
worker.jetty.lbfactor=2
Ajp port for projectA is 8007. For projectB is 8009 localport for projectA is 8080. For projectB is 8088
And the result is only one of them work. Any ideas? Maybe the problem of port?
As far as I know, there might only be one worker.list property in that file. Did you try something like:
worker.list=ajp13,jetty
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.