您当前的位置: 首页 > 网络技术  > 服务器教程 浏览
Apache服务器中设置端口映射和反向代理的方法
发布时间:2015-12-12    点击率:次    来源:www.sytcke.com    作者:电脑技术学习网

 httpd.conf文件 ###new add for webui.cong###

Include "E:/local/Wamp/bin/apache/Apache2.2.17/conf/webui_port.conf" Include "E:/local/Wamp/bin/apache/Apache2.2.17/conf/webui_proxy.conf" webui_port.conf文件

#proxy本地端口映射

DocumentRoot "E:/www/yingshe/"     Options -Indexes FollowSymLinks MultiViews     AllowOverride all     Order Deny,Allow     Deny from all     Allow from all DirectoryIndex index.php </VirtualHost> ProxyPass /yingshe http://192.168.10.12:8080/ ProxyPassReverse /yingshe http://192.168.10.12:8080/ <proxy http://192.168.10.12:8080/> AllowOverride None Order Deny,Allow Allow from all </proxy>

webui_proxy.conf文件 #proxy远程反响代理

Listen 8002 <VirtualHost *:8002>     SSLProxyEngine on     ProxyRequests on     ProxyPass /      https://192.168.10.201/     ProxyPassReverse /   https://192.168.10.201/     <proxy   https://192.168.10.201/>       AllowOverride None       Order Deny,Allow       Allow from all     </proxy> </VirtualHost>

总结 #Apache mod_proxy做反向代理 ##要做更多支持请开启以下相应module ##proxy_module ##反向代理模块 ##proxy_http_module ##反向代理http协议模块 ##Rewrite_module ##地址重写 ##ssl_module ##ssl协议模块 ######################################################## # 通过https请求apache,apache也通过https访问系统 ########################################################

Listen 443 <VirtualHost *:443>   ProxyRequests On   # 声明ssl代理引擎   SSLProxyEngine on   # 这里声明代理的URL转换处理   # 注意需要使用域名,否则证书、用户页面的URL会有问题   ProxyPass / https://www.×××.com/   ProxyPassReverse / https://www.×××.com/   #此处项目名称 /https://www.×××.com/ 代理为 / 跟目录访问,session会丢失,需要配置如下信息    ProxyPassReverseCookiePath /https://www.×××.com / </VirtualHost> ############################################################# # 通过http请求apache,apache也通过http访问代理站点 ############################################################# Listen 80 <VirtualHost *:80>   ProxyRequests On   ProxyPass / http://www.×××.com/   ProxyPassReverse / http://www.×××.com/   ProxyPassReverseCookiePath /https://www.×××.com /   <proxy   https://www.×××.com>       AllowOverride None       Order Deny,Allow       Allow from all   </proxy> </VirtualHost> ######################################################## # 通过http请求apache,apache通过https访问系统 ######################################################## Listen 8002 <VirtualHost *:8002>   ProxyRequests On   # 声明ssl代理引擎   SSLProxyEngine on   # 这里声明代理的URL转换处理   # 注意需要使用域名,否则证书、用户页面的URL会有问题   ProxyPass / https://www.×××.com/   ProxyPassReverse / https://www.×××.com/   #此处项目名称 /https://www.×××.com/ 代理为 / 跟目录访问,session会丢失,需要配置如下信息    ProxyPassReverseCookiePath /https://www.×××.com /   <proxy   https://www.×××.com>       AllowOverride None       Order Deny,Allow       Allow from all         </proxy> </VirtualHost>

来源 电脑技术网 www.sytcke.com
发表留言
发表留言请先登录!
免责声明:本站发布的信息和评论纯属网民个人行为,并不代表本站立场,如发现有违法信息或侵权行为,请直接与本站管理员联系,我们将在收到您的信息后24小时内作出处理!