正向配置
#这是扫描所有的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