个人工具
登录
查看“Apache2 reverse proxies”的源代码 - Ubuntu中文
页面
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“Apache2 reverse proxies”的源代码
来自Ubuntu中文
←
Apache2 reverse proxies
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
This solution solves the problem of having multiple servers on a LAN which has a single router connected to the Internet. The router forwards all port 80 traffic to a single primary server. That server will then be required to act as a proxy for the other servers on the LAN, redirecting incoming traffic addressed to the URLs of those other servers to their respective LAN IP addresses. This increases the amount of traffic passing through the primary server, so is not a recommended solution for high volume situations unless the primary server is a dedicated gateway/proxy server. This method uses Apache2 virtual host configuration files on the primary server (to which the router sends port 80 traffic). *On the primary server (which will act as the proxy), create a symbolic link to enable the proxy modules in Apache2, then restart Apache2: sudo ln -s /etc/apache2/mods-available/proxy.load /etc/apache2/mods-enabled sudo ln -s /etc/apache2/mods-available/proxy_http.load /etc/apache2/mods-enabled sudo /etc/init.d/apache2 restart *Edit a virtual host file for all secondary servers: sudo gedit /etc/apache2/sites-enabled/proxiedhosts :and edit the file so that it resembles: <VirtualHost *:80> # ServerName ''internalserver2.mydomain.org'' # ProxyPreserveHost On ProxyRequests off ProxyPass / http://''192.168.1.192''/ ProxyPassReverse / http://''192.168.1.192''/ # </VirtualHost> # #<VirtualHost *:80> # #ServerName ''internalserver3.mydomain.org' # # ProxyPreserveHost On # ProxyRequests off # ProxyPass / http://''192.168.1.193''/ # ProxyPassReverse / http://''192.168.1.193''/ # #</VirtualHost> # #<VirtualHost *:80> # #ServerName ''internalserver4.mydomain.org' # # ProxyPreserveHost On # ProxyRequests off # ProxyPass / http://''192.168.1.194''/ # ProxyPassReverse / http://''192.168.1.194''/ # #</VirtualHost> :Makes each URL for each server has an entry (and obviously remove the hashmarks for each one that is active). *Activate the virtual host file by making a symbolic link to the Apache2 sites-enabled folder then restarting Apache2: sudo ln -s /etc/apache2/sites-enabled/proxiedhosts /etc/apache2/sites-enabled sudo /etc/init.d/apache2 restart == Other resources == The information for this page was synthesized from these sources: *[http://jeffbaier.com/articles/configuring-apache-virtual-hosts-for-nat/ Configuring Apache virtual hosts for NAT] -- blog tutorial for Apache ProxyPass *[http://www.raskas.be/blog/2006/04/21/reverse-proxy-of-virtual-hosts-with-apache-2/ Reverse proxy of virtual hosts with apache 2] *[http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass Apache2 mod_proxy instructions]
返回至
Apache2 reverse proxies
。