我使用Apache 和 Tomcat 之间的AJP 连接器来完成。这是我在配置文件中使用的片段:
Apache 的部分配置($APACHE_DIR/sites-available/default):
NameVirtualHost *:80
NameVirtualHost *:443
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
JkWorkersFile /etc/apache2/workers.conf
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
<VirtualHost *:80>
ServerName brasee.com
ServerAlias www.brasee.com
JkMount /* ajp13secured
</VirtualHost>
Tomcat 的部分配置(conf/server.xml):
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- Define an AJP 1.3 Connector on port 8008 -->
<Connector port="8008" protocol="AJP/1.3" redirectPort="8080" />