【WAMP】使用记录

Table of Contents

1 更改虚拟目录

WAMP 安装好之后,网站默认目录是安装目录下的 www 文件夹,可能需要改成其他更适合我们的文件夹:

  • wamp\script\config.inc.php

    L61:change

  $wwwDir =$c_installDir.’/www’;

to

     $wwwDir = my_path ;
  • wamp\bin\apache\apache2.2.11\conf\httpd.conf

    L230:change

     DocumentRoot “C:/wamp/www/”

to

     DocumentRoot my_path

L252:change

     <Directory “C:/wamp/www/“>

to

     <Directory my_path>

2 开启多站点功能

wamp\bin\apache\apache2.4.9\conf\httpd.conf L513:去掉注释

     Include conf/extra/httpd-vhosts.conf

C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf

  <VirtualHost *:80>
      ServerAdmin panghuli_root@main.localhost.com
      DocumentRoot "D:/my_files/projects/panghuli_site/public_html/main"
      ServerName main.localhost.com
      ErrorLog "logs/main.localhost.com-error.log"
      CustomLog "logs/main.localhost.com.log" common
  </VirtualHost>

  <VirtualHost *:80>
      ServerAdmin panghuli_blog@blog.localhost.com
      DocumentRoot "D:/my_files/projects/panghuli_site/public_html/blog"
      ServerName blog.localhost.com
      ErrorLog "logs/blog.localhost.com-error.log"
      CustomLog "logs/blog.localhost.com.log" common
  </VirtualHost>

c:\windows\system32\drivers\etc\host 添加以下内容

  127.0.0.1       blog.localhost.com
  127.0.0.1       main.localhost.com

*

Author: lsl

Created: 2016-08-07 Sun 19:48

Validate