apache 虚拟主机配置(不一样目录映射不一样域名)

1》本地Apache安装目录

1:F:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.confphp


增长
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80


<virtualhost *:80>
  DirectoryIndex index.html index.php
  ServerName web.cn 
  DocumentRoot "F:\wamp\www\commonlib\project_name\src\www"
  <directory "F:\wamp\www\commonlib\project_name\src\www">
    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>


2:F:\wamp\bin\apache\apache2.4.9\conf\httpd.conf
开启
Include conf/extra/httpd-vhosts.conf


3:配置本地host

127.0.0.1  web.cn


4重启wamphtml

相关文章
相关标签/搜索