Apache反向代理设置方法
来源:互联网 发布:mac版的优酷能缓存吗 编辑:程序博客网 时间:2024/05/22 01:42
打开 apache 安装目录的 conf 文件夹(linux 在 /etc/httpd/conf 或者 /usr/local/apache/conf)
打开 httpd.conf
把
LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_http_module modules/mod_proxy_http.so
前面的注释去掉
在 httpd.conf 最后添上
NameVirtualHost *:80<VirtualHost *:80>ServerName www.truemv.comServerAlias www.truemv.comProxyRequests Off<Proxy http://www.truemv.com> Options MultiViews AllowOverride None Order allow,deny Allow from all</Proxy>ProxyPass / http://61.191.191.4:9002/ProxyPassReverse / http://61.191.191.4:9002/</VirtualHost><VirtualHost *:80>ServerName img.truemv.comServerAlias img.truemv.comProxyRequests Off<Proxy http://img.truemv.com> Options MultiViews AllowOverride None Order allow,deny Allow from all</Proxy>ProxyPass / http://61.191.191.4:9003/ProxyPassReverse / http://61.191.191.4:9003/</VirtualHost>
其中
NameVirtualHost *:80
这句话是告诉apache用域名来区分访问来源,apache支持用域名和ip两种,用ip的话,你的机子上的VirtualHost需要绑定多个ip
附录:
<VirtualHost *:9002>ServerName localhostServerAlias localhostDocumentRoot "x:/xxxx/upload/"<Directory "x:/xxxx/upload/"> Options MultiViews AllowOverride None Order allow,deny Allow from all</Directory>RewriteEngine on RewriteRule ^/artist-(\d+).html$ /artist.php?id=$1 RewriteRule ^/theme-(\d+).html$ /theme.php?themeid=$1 RewriteRule ^/artist-list-(.+).html$ /artist_list.php?tp=$1 RewriteRule ^/theme-list.html$ /theme_list.php</VirtualHost><VirtualHost *:9003>ServerName localhostServerAlias localhostDocumentRoot "x:/xxxx/mv_img/"<Directory "x:/xxxx/mv_img/"> Options MultiViews AllowOverride None Order allow,deny Allow from all</Directory></VirtualHost>AddType video/x-flv .flv<VirtualHost *:9004>ServerName localhostServerAlias localhostDocumentRoot "x:/xxxx/vod/"<Directory "x:/xxxx/vod/"> Options MultiViews AllowOverride None Order allow,deny Allow from all</Directory></VirtualHost><VirtualHost *:9005>ServerName localhostServerAlias localhostDocumentRoot "x:/xxxx/vod2/"<Directory "x:/xxxx/vod2/"> Options MultiViews AllowOverride None Order allow,deny Allow from all</Directory></VirtualHost><VirtualHost *:9006>ServerName localhostServerAlias localhostDocumentRoot "x/truemv_wap/"<Directory "x:/truemv_wap/"> Options MultiViews AllowOverride None Order allow,deny Allow from all DirectoryIndex index.php</Directory></VirtualHost><VirtualHost *:9007>ServerName localhostServerAlias localhostDocumentRoot "x:/xxx/xxx/"<Directory "x:/xxx/xxx/"> Options MultiViews AllowOverride None Order allow,deny Allow from all DirectoryIndex index.php</Directory></VirtualHost><VirtualHost *:9008>ServerName localhostServerAlias localhostDocumentRoot "x:/xxxx/xxx/"<Directory "x:/xxxx/xxx/"> Options MultiViews AllowOverride None Order allow,deny Allow from all DirectoryIndex index.php</Directory></VirtualHost>
0 0
- Apache反向代理设置方法
- Apache反向代理设置
- Apache反向代理设置
- Apache反向代理设置
- Apache设置反向代理
- Apache反向代理设置
- apache 反向代理tomcat设置
- Apache设置https反向代理
- apache https反向代理设置方案
- apache https反向代理设置方案
- apache https反向代理设置方案
- apache https反向代理设置方案
- Apache反向代理设置一例
- 为OpenERP7.0设置Apache反向代理
- 为OpenERP7.0设置Apache反向代理
- 为OpenERP7.0设置Apache反向代理
- centos下apache反向代理设置
- Ubuntu下Apache反向代理设置
- struts2的拦截器及实现
- 蛋蛋的伤不起
- 第三周第二章
- ListView设置emptyView的限制
- 数据库
- Apache反向代理设置方法
- Mac OS X 键盘字母键和数字键的切换
- 编写ADF 验证
- 用ListView搭建手机通讯录
- GROUP BY的用法
- 开发中的自动化——按键精灵&AutoIt
- Linux 服务器监控命令
- leetcode Palindrome Partitioning
- STM32时钟设置