Apache爲Tomcat建立代理的配置

Apache做爲Tomcat的代理的配置:

1. 註解Apache帶來的模塊:web

    LoadModule proxy_module modules/mod_proxy.sotomcat

    LoadModule proxy_ajp_module modules/mod_proxy_ajp.sospa

    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so代理

    LoadModule proxy_connect_module modules/mod_proxy_connect.soit

    LoadModule proxy_http_module modules/mod_proxy_http.soio

2. 寫帶來的配置文件:ast

    配置文件的主要內容:module

<VirtualHost *:80>配置

    ServerAdmin webmaster@dummy-host.360buyAD.localerror

    DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

    ServerName sport.dongjiejie.com

    ServerAlias www.dummy-host.360buyAD.local

    ErrorLog "logs/dummy-host.360buyAD.local-error.log"

    CustomLog "logs/dummy-host.360buyAD.local-access.log" common

</VirtualHost>

 

<VirtualHost *:80>

    ServerAdmin webmaster@dummy-host2.360buyAD.local

    ServerName examples.dongjiejie.com

    ProxyPreserveHost On

    ProxyRequests Off

 

    ProxyPass / http://127.0.0.1:8080/

    ProxyPassReverse / http://127.0.0.1:8080/

    ErrorLog "logs/dummy-host2.360buyAD.local-error.log"

    CustomLog "logs/dummy-host2.360buyAD.local-access.log" common

</VirtualHost>

    將這個配置文件命名爲httpd-vhost-tomcat.conf

3.Apache中添加對vhost文件的引入。重啓Aapche服務。

    Include conf/extra/httpd-vhosts-tomcat.conf

相關文章
相關標籤/搜索