apache配置反向代理(通过不同端口访问不同目录)
生活随笔
收集整理的這篇文章主要介紹了
apache配置反向代理(通过不同端口访问不同目录)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
可參考:https://www.cnblogs.com/liyuanhong/articles/7355545.html
一、開啟apache代理模塊,開啟vhost虛擬主機(jī)功能
開啟代理模塊,編輯http.conf 文件:
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so開啟虛擬主機(jī)功能,引入vhost文件
Include conf/extra/httpd-vhosts.conf開啟想要監(jiān)聽的端口:
Listen 80 Listen 8080二、配置vhost文件
如下,參見我的配置:
<VirtualHost *:80>ServerAdmin webmaster@dummy-host.example.comDocumentRoot "/opt/lampp/htdocs/"ServerName www.xxxx.cnServerAlias www.xxxx.cnErrorLog "logs/dummy-host.example.com-error_log"CustomLog "logs/dummy-host.example.com-access_log" common<Directory "/opt/lampp/htdocs/">Options FollowSymLinksAllowOverride AllOrder allow,denyAllow from all</Directory> </VirtualHost><VirtualHost *:8080>ServerAdmin 192.168.0.108DocumentRoot "/opt/lampp/htdocs/devman/public/"ServerName 192.168.0.108ErrorLog "logs/dummy-host2.example.com-error_log"CustomLog "logs/dummy-host2.example.com-access_log" common<Directory "/opt/lampp/htdocs/devman/public/">Options FollowSymLinksAllowOverride AllOrder allow,denyAllow from all</Directory> </VirtualHost><VirtualHost *:8080>ServerAdmin www.xxxx.cnDocumentRoot "/opt/lampp/htdocs/devman/public/"ServerName www.xxxx.cnErrorLog "logs/dummy-host2.example.com-error_log"CustomLog "logs/dummy-host2.example.com-access_log" common<Directory "/opt/lampp/htdocs/devman/public/">Options FollowSymLinksAllowOverride AllOrder allow,denyAllow from all</Directory> </VirtualHost>解釋:<VirtualHost *:80>
以上:
?
?
?
總結(jié)
以上是生活随笔為你收集整理的apache配置反向代理(通过不同端口访问不同目录)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: wireshark抓取https并解密方
- 下一篇: ping 出现(DUP)以及连接虚拟机s