如果原来的httpd.conf是正确的话,请保持不动,然后现最后的一行加上这两句:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

然后打开httpd.conf同一目录下的extra/httpd-vhosts.conf文件

修改如下:

<VirtualHost *:80>
    ServerAdmin XX@XX.com
    DocumentRoot "X:/wwwroot/web"
    ServerName XX.XX.cn
    ServerAlias XX.XX.cn
    ErrorLog "logs/XX.XX.cn-error.log"
    CustomLog "logs/XX.XX.cn-access.log" common
 <Directory "X:/wwwroot/web">
  Order allow,deny
  Allow from all
  DirectoryIndex index.asp index.html index.php index.htm Default.htm Default.aspx index.aspx
 </Directory>
</VirtualHost>

 

<VirtualHost *:80>
    ServerAdmin XX@XX.com
    DocumentRoot "X:/wwwroot/web1"
    ServerName XX.XX.org
    ServerAlias XX.XX.org
    ErrorLog "logs/XX.XX.org-error.log"
    CustomLog "logs/XX.XX.org-access.log" common
 <Directory "X:/wwwroot/web">
  Order allow,deny
  Allow from all
  DirectoryIndex index.asp index.html index.php index.htm Default.htm Default.aspx index.aspx
 </Directory>
</VirtualHost>

 

然后重启Apache,就OK了

 

相关文章:

  • 2021-11-20
  • 2022-12-23
  • 2021-04-04
  • 2021-07-23
  • 2022-02-07
  • 2022-12-23
猜你喜欢
  • 2021-09-05
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
相关资源
相似解决方案