yangzailu

导航

apache配置

apache的配置路径在C:\wamp\bin\apache\apache2.4.9\conf\extra下的httpd-vhosts.conf中:

1.配置:

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "e:/www/PropertyCenter/02 coding/04 customer system-web"      
    ServerName web.zongkong.com
    #ServerAlias www.dummy-host.example.com
    #ErrorLog "logs/dummy-host.example.com-error.log"
    #CustomLog "logs/dummy-host.example.com-access.log" common
    
    <Directory "e:/www/PropertyCenter/02 coding/04 customer system-web">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>

    <IfModule mod_rewrite.c>
        RewriteEngine on
          RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
        RewriteRule .* - [F]
          Rewriterule ^(.*)/(.*)/index.html$ $1/index.php?$2
        Rewriterule ^(.*)/(.*)/index(\d+).html$ $1/index.php?$2&page=$3
        Rewriterule ^(.*)/(.*)/a(\d+)\.html$ $1/index.php?$2/$3
        Rewriterule ^(.*)/u/(\d+)/(.*)$ $1/index.php?u&$2&$3
        Rewriterule ^(.*)/u/(\d+)/(.*)/$ $1/index.php?u&$2&$3
        Rewriterule ^(.*)/u/(\d+)$ $1/index.php?u&$2
        Rewriterule ^(.*)/u/(\d+)/$ $1/index.php?u&$2
        Rewriterule ^(.*)/(.*)/index.html\?(.*) $1/index.php?$2&$3
        Rewriterule ^(.*)/(.*)/index(\d+).html\?(.*) $1/index.php?$2&$3
        Rewriterule ^(.*)/index.action(.*) $1/index.php$3
    </IfModule>
    
</VirtualHost>

 

<VirtualHost  *:80>
    DocumentRoot  "D:/www/Admin/app/webroot/"
    ServerName web.admin.com
</VirtualHost>

<VirtualHost  *:80>
    DocumentRoot  "D:/www/FrontDesk/app/webroot/"
    ServerName web.rongbei.com
</VirtualHost>

2,打开Apache的安装目录,找到httpd.conf文件,分别去掉下面两行文字前面的#号。  
LoadModule vhost_alias_module modules/mod_vhost_alias.so
去掉#意思是启用apache的虚拟主机功能。  
Include conf/extra/httpd-vhosts.conf  
去掉这一行的#意思是从conf/extra/httpd-vhosts.conf这个文件导入虚拟主机配置。

3.httpd.conf

 

posted on 2017-03-20 09:49  飞离地平线  阅读(194)  评论(0编辑  收藏  举报