文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>apache_proxy配置

apache_proxy配置

时间:2010-08-02  来源:luanqibazao

目的隐藏源路径后剩下的路径转到需要路径,如:打开gonline.yesky.com显示首页为yesky.comic.gonline.com/comic页
打开apache的proxy_http模块(也打开了proxy模块,依赖关系):     a2enmod proxy     a2enmod proxy_http
配置proxy.conf 

<IfModule mod_proxy.c>
        #turning ProxyRequests on and allowing proxying from all may allow
        #spammers to use your proxy to send email.

        ProxyRequests Off

        <Proxy 10.50.21.140:8080>
# AddDefaultCharset off
                Order deny,allow
                #Deny from all
                Allow from all
                #Allow from .example.com
        </Proxy>

        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
        # Set to one of: Off | On | Full | Block

# ProxyVia On
</IfModule>

配置VirtualHost
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DirectoryIndex index.php index.html index.htm
    DocumentRoot /opt/www_data/yesky.comic.gonline.com/public_html
    ServerName gonline.yesky.com
    <Directory /opt/www_data/yesky.comic.gonline.com/public_html>
        Options Indexes FollowSymLinks Multiviews
        AllowOverride All
    </Directory>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^/$ http://yesky.comic.gonline.com/comic/ [P]
    RewriteCond %{REQUEST_URI} !^/$
    RewriteRule ^/comic/(.+)$ http://yesky.comic.gonline.com/comic/$1 [R=301,L]
    RewriteCond %{REQUEST_URI} !^/comic/|^/images/|^/src/|^/comic$|^/index.php/comic/|^/index.php/comic$|crossdomain.xml|/tasks/|/gce/|/award/|/toolbar/|/cartoon/|/book/|/search/
    RewriteRule ^/(.*) http://www.gonline.com/$1 [R=301,L]
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DirectoryIndex index.php index.html index.htm
    DocumentRoot /opt/www_data/yesky.comic.gonline.com/public_html
    ServerName yesky.comic.gonline.com
    <Directory /opt/www_data/yesky.comic.gonline.com/public_html>
        Options Indexes FollowSymLinks Multiviews
        AllowOverride All
    </Directory>
    ErrorLog /opt/www_data/nfs_from_10/logs/error_yesky.comic.gonline.com.log
    CustomLog /opt/www_data/nfs_from_10/logs/access_yesky.comic.gonline.com.log combined

    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/comic/|^/images/|^/src/|^/comic$|^/index.php/comic/|^/index.php/comic$|crossdomain.xml|/tasks/|/gce/|/award/|/toolbar/|/cartoon/|/book/|/search/
    RewriteRule ^/(.*) http://www.gonline.com/$1 [R=301,L]
</VirtualHost>


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载