apache vhost 默认设置

因为有的时候会改坏这个部分,所以留个档……

文件位置:

D:\phpnow\Apache-20\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot d:/www/
ServerName localhost
ErrorLog logs/dummy-host2.localhost-error_log
CustomLog logs/dummy-host2.localhost-access_log common
</VirtualHost>

<VirtualHost *:80>    ServerAdmin webmaster@dummy-host2.localhost    DocumentRoot d:/www/    ServerName localhost    ErrorLog logs/dummy-host2.localhost-error_log    CustomLog logs/dummy-host2.localhost-access_log common</VirtualHost>

这个是默认的,访问localhost的配置……另外如果你的localhost无论怎么配置(已经按照这里说明的配置)仍然出现403的话,问下自己是否启用了VHOST?在VHOST里确认下localhost的指向,这里我提供我的vhost文件供参考,里面只有2段内容,一段为本地localhost的配置,一段为虚拟机的配置。

 

# Virtual Hosts

#

# Required modules: mod_log_config

 

#localhost

<VirtualHost *:80>

DocumentRoot “/Applications/XAMPP/xamppfiles/htdocs/”

ErrorLog “logs/localhost-error_log”

CustomLog “logs/localhost-access_log” common

</VirtualHost>

 

 

#虚拟机

<VirtualHost *:80>

DocumentRoot “/Applications/XAMPP/xamppfiles/htdocs/sheying/”

ServerName www.sheying.com

ErrorLog “logs/sheying-error_log”

CustomLog “logs/sheying-access_log” common

</VirtualHost>

 

 

原创文章,转载请注明: 转载自konakona

本文链接地址: apache vhost 默认设置

团哥

继续玩我的CODE,让别人说去。 低调,就是这么自信。

You may also like...