wamp 中配置Vhost

版本:WampServer2.3-beta-x32
文件===============================================php.ini
error_reporting = E_ALL  & ~E_NOTICE & ~E_DEPRECATED
文件===============================================apache httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so

Include conf/extra/httpd-vhosts.conf
MAMP则是:Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
文件===============================================hosts

C:/Windows/System32/drivers/etc/hosts

127.0.0.1       localhost
127.0.0.1       www.bonck.com
127.0.0.1       admin.bonck.com
127.0.0.1       t
127.0.0.1       p
127.0.0.1       pg


文件===============================================httpd.conf

<Directory />
    Order allow,deny
Allow from all
AllowOverride All
</Directory>

文件===============================================添加localhost  httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin webmaster@example.com
    DocumentRoot "D:\wamp\www"
    ServerName localhost
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" common
</VirtualHost>


文件===============================================httpd-vhosts.conf
<virtualhost *:80>
  DirectoryIndex index.html index.php
  ServerName localhost
  DocumentRoot "D:/wamp/www"
  <directory "D:/wamp/www">
    Options Indexes FollowSymLinks Includes ExecCGI
    DirectoryIndex index.html index.htm  index.php
    AllowOverride All
    Order allow,deny
    Allow from all
  </directory>
  ErrorLog "logs/error.log"
  CustomLog "logs/access.log" common

</virtualhost>

<virtualhost *:80>
  DirectoryIndex index.html index.php
  ServerName admin.bonck.com
  DocumentRoot "D:/PROJ/cpa_admin"
  <directory "D:/PROJ/cpa_admin">
    Options Indexes FollowSymLinks Includes ExecCGI
    DirectoryIndex index.html index.htm  index.php
    AllowOverride All
    Order allow,deny
    Allow from all
  </directory>
  ErrorLog "logs/error.log"
  CustomLog "logs/access.log" common

</virtualhost>

<virtualhost *:80>
  DirectoryIndex index.html index.php
  ServerName www.bonck.com
  DocumentRoot "D:/PROJ/cpa_front"
  <directory "D:/PROJ/cpa_front">
    Options Indexes FollowSymLinks Includes ExecCGI
    DirectoryIndex index.html index.htm  index.php
    AllowOverride All
    Order allow,deny
    Allow from all
  </directory>
  ErrorLog "logs/error.log"
  CustomLog "logs/access.log" common

</virtualhost>

<virtualhost *:80>
  DirectoryIndex index.html index.php
  ServerName t
  DocumentRoot "D:/wamp/www2/t"
  <directory "D:/wamp/www2/t">
    Options Indexes FollowSymLinks Includes ExecCGI
    DirectoryIndex index.html index.htm  index.php
    AllowOverride All
    Order allow,deny
    Allow from all
  </directory>
  ErrorLog "logs/error.log"
  CustomLog "logs/access.log" common
</virtualhost>

<virtualhost *:80>
  DirectoryIndex index.html index.php
  ServerName p
  DocumentRoot "D:/wamp/www2/p"
  <directory "D:/wamp/www2/p">
    Options Indexes FollowSymLinks Includes ExecCGI
    DirectoryIndex index.html index.htm  index.php
    AllowOverride All
    Order allow,deny
    Allow from all
  </directory>
  ErrorLog "logs/error.log"
  CustomLog "logs/access.log" common
</virtualhost>

<virtualhost *:80>
  DirectoryIndex index.html index.php
  ServerName pg
  DocumentRoot "D:/wamp/www2/pg"
  <directory "D:/wamp/www2/pg">
    Options Indexes FollowSymLinks Includes ExecCGI
    DirectoryIndex index.html index.htm  index.php
    AllowOverride All
    Order allow,deny
    Allow from all
  </directory>
  ErrorLog "logs/error.log"
  CustomLog "logs/access.log" common
</virtualhost>









文件===============================================httpd.conf
<VirtualHost 192.168.4.32:80>
    DocumentRoot D:/wamp/www/tour/
ServerName www.boncktrip.com
RedirectMatch ^/$ http://www.boncktrip.com/index.php
</VirtualHost>


<VirtualHost 192.168.4.32:80>
    DocumentRoot D:/wamp/www/tour/
ServerName boncktrip.com
RedirectMatch ^/$ http://www.boncktrip.com/index.php
</VirtualHost>

文件===============================================httpd-vhosts.conf
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值