xampp 多站点配置

来源:互联网 发布:软件测试考题 编辑:程序博客网 时间:2024/05/16 04:35


会打开软件的安装目录,选择.\apache\conf\extra\httpd-vhosts.conf  ,打开。

添加如下内容:


[html] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. <VirtualHost 127.0.0.2:80>  
  2.     ServerAdmin "127.0.0.2:80"    
  3.     DocumentRoot "E:/wwwroot/xxx"  
  4.     ServerName 127.0.0.2  
  5.     ErrorLog "logs/xxx.log"  
  6.     CustomLog "logs/xxx.log" combined  
  7. </VirtualHost>   
  8.   
  9. DocumentRoot "E:/wwwroot"  
  10. <Directory "E:/wwwroot">  
  11.     #  
  12.     # Possible values for the Options directive are "None", "All",  
  13.     # or any combination of:  
  14.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews  
  15.     #  
  16.     # Note that "MultiViews" must be named *explicitly* --- "Options All"  
  17.     # doesn't give it to you.  
  18.     #  
  19.     # The Options directive is both complicated and important.  Please see  
  20.     # http://httpd.apache.org/docs/2.4/mod/core.html#options  
  21.     # for more information.  
  22.     #  
  23.     Options Indexes FollowSymLinks Includes ExecCGI  
  24.   
  25.     #  
  26.     # AllowOverride controls what directives may be placed in .htaccess files.  
  27.     # It can be "All", "None", or any combination of the keywords:  
  28.     #   AllowOverride FileInfo AuthConfig Limit  
  29.     #  
  30.     AllowOverride All  
  31.   
  32.     #  
  33.     # Controls who can get stuff from this server.  
  34.     #  
  35.     Require all granted  
  36. </Directory>  

,之后依次添加127.0.0.3,127.0.0.4,就直接复制

[html] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. <VirtualHost 127.0.0.3:80>  
  2.     ServerAdmin "127.0.0.3:80"    
  3.     DocumentRoot "E:/wwwroot/yyy"  
  4.     ServerName 127.0.0.3  
  5.     ErrorLog "logs/yyy.log"  
  6.     CustomLog "logs/yyy.log" combined  
  7. </VirtualHost>   

比较简单,而且不用再修改hosts文件了。

0 0
原创粉丝点击