One - One Code All

Blog Content

Apache httpd端口正反向代理

PHP WEB   2017-07-22 12:02:42

正向配置

 #这是扫描所有的80端口
DocumentRoot /www/web/default #这里是默认服务器上的文件路径
ServerName www.xxx.com #访问地址
ServerAlias xxx.com    #域名
   ErrorDocument 400 /errpage/400.html #错误文件跳转
   ErrorDocument 403 /errpage/403.html #错误文件跳转
   ErrorDocument 404 /errpage/404.html #错误文件跳转
   ErrorDocument 503 /errpage/503.html #错误文件跳转

   #这里是默认服务器上的文件路径
   Options FollowSymLinks
   AllowOverride None
   Require all granted

端口反向映射



ServerName www.git.xxx.com #访问地址
ServerAlias git.xxx.com #域名

ProxyPreserveHost On #开启
ProxyRequests Off #开启
ProxyPass / http://172.000.000.21:9000/ #这里填ip+端口
ProxyPassReverse / http://172.000.000.21:9000/ # #这里填ip+端口,在这里做映射

配置模块开启conf/httpd.conf

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_modulemodules/mod_proxy_connect.so
LoadModule proxy_http_modulemodules/mod_proxy_http.so
LoadModule proxy_ftp_modulemodules/mod_proxy_ftp.so



上一篇:laydate 时间框弹窗点击弹出后立马消失的问题解决
下一篇:CentOS 6.5 安装 Kong0.14

The minute you think of giving up, think of the reason why you held on so long.