apache 通過ajp訪問tomcat多個站點

快樂就好發表於2018-10-29

copy mod_jk.so to modules下

httpd的配置項中新增如下內容

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

LoadModule jk_module modules/mod_jk.so

<VirtualHost *:80>
ServerName a1.b.com
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
</VirtualHost>


<VirtualHost *:80>
ServerName a2.b.com
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
</VirtualHost>

相關文章