2010-06-27 146 views
1

请帮助我,我拉着我的头发。我无法让虚拟主机与WAMP一起工作。我已经注释掉了这行:WAMP虚拟主机无法正常工作

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

这是我的httpd-vhosts.conf文件:

# 
# Virtual Hosts 
# 
# If you want to maintain multiple domains/hostnames on your 
# machine you can setup VirtualHost containers for them. Most configurations 
# use only name-based virtual hosts so the server doesn't need to worry about 
# IP addresses. This is indicated by the asterisks in the directives below. 
# 
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.2/vhosts/> 
# for further details before you try to setup virtual hosts. 
# 
# You may use the command line option '-S' to verify your virtual host 
# configuration. 

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

# 
# VirtualHost example: 
# Almost any Apache directive may go into a VirtualHost container. 
# The first VirtualHost section is used for all requests that do not 
# match a ServerName or ServerAlias in any <VirtualHost> block. 
# 
<VirtualHost 127.0.0.1> 
    DocumentRoot "C:\wamp\www" 
    ServerName localhost 
</VirtualHost> 
<VirtualHost 127.0.0.1> 
    DocumentRoot "C:\wamp\www\project\public" 
    ServerName project 
    ErrorLog "logs/project.localhost.error.log" 
    CustomLog "logs/project.localhost.access.log" common 
</VirtualHost> 

我在做什么错?我的错误在哪里?为什么它不显示我的虚拟主机?

+1

第一次重新格式化您的帖子,第二次描述到底是什么对您不起作用,最后但并非最不重要,这是服务器故障的问题。 – joschi 2010-06-27 06:16:54

回答

0

我找到了答案。我忘了在Windows主机文件中添加主机名。

+0

请添加你遵循的步骤。 – Bharanikumar 2012-12-25 14:41:08

+0

这是1行输入为 ipaddress hostname 127.0.0.1 www.example.com 这只是一个例子。你需要替换你的IP地址和主机名。 – 2013-01-09 06:12:42