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 [email protected]
    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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章