<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/nmb48/public/"
ServerName nmb48.local
<Directory C:/wamp/www/nmb48/public/>
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
Apache错误:
[Wed Dec 04 16:47:51.919206 2013] [core:error] [pid 15872:tid 348] (OS 11001)No such host is known. : AH00547: Could not resolve host name *: -- ignoring!
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host.example.com] does not exist
[Wed Dec 04 16:47:54.169335 2013] [core:error] [pid 15872:tid 348] (OS 11001)No such host is known. : AH00547: Could not resolve host name *: -- ignoring!
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host2.example.com] does not exist
[Wed Dec 04 16:47:54.193336 2013] [mpm_winnt:notice] [pid 15872:tid 348] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Wed Dec 04 16:47:54.193336 2013] [mpm_winnt:notice] [pid 15872:tid 348] AH00456: Server built: Feb 22 2013 22:08:37
[Wed Dec 04 16:47:54.193336 2013] [core:notice] [pid 15872:tid 348] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Wed Dec 04 16:47:54.194336 2013] [mpm_winnt:notice] [pid 15872:tid 348] AH00418: Parent: Created child process 15972
[Wed Dec 04 16:47:56.903491 2013] [core:error] [pid 15972:tid 240] (OS 11001)No such host is known. : AH00547: Could not resolve host name *: -- ignoring!
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host.example.com] does not exist
[Wed Dec 04 16:47:59.154620 2013] [core:error] [pid 15972:tid 240] (OS 11001)No such host is known. : AH00547: Could not resolve host name *: -- ignoring!
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host2.example.com] does not exist
[Wed Dec 04 16:48:01.428750 2013] [core:error] [pid 15972:tid 240] (OS 11001)No such host is known. : AH00547: Could not resolve host name *: -- ignoring!
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host.example.com] does not exist
[Wed Dec 04 16:48:03.678878 2013] [core:error] [pid 15972:tid 240] (OS 11001)No such host is known. : AH00547: Could not resolve host name *: -- ignoring!
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host2.example.com] does not exist
[Wed Dec 04 16:48:03.699880 2013] [mpm_winnt:notice] [pid 15972:tid 240] AH00354: Child: Starting 150 worker threads.
我是否更改或删除虚拟主机80?
我已删除virtualhost *:80并添加
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/nmb48/public/"
ServerName nmb48.local
<Directory C:/wamp/www/nmb48/public/>
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
新错误:
[Thu Dec 05 10:00:43.523014 2013] [mpm_winnt:notice] [pid 5404:tid 392] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Thu Dec 05 10:00:43.523014 2013] [mpm_winnt:notice] [pid 5404:tid 392] AH00456: Server built: Feb 22 2013 22:08:37
[Thu Dec 05 10:00:43.523014 2013] [core:notice] [pid 5404:tid 392] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Thu Dec 05 10:00:43.525014 2013] [mpm_winnt:notice] [pid 5404:tid 392] AH00418: Parent: Created child process 4552
AH00548: NameVirtualHost has no effect and will be removed in the next release C:/wamp/bin/apache/Apache2.4.4/conf/extra/httpd-vhosts.conf:1
[Thu Dec 05 10:00:44.218054 2013] [mpm_winnt:notice] [pid 4552:tid 284] AH00354: Child: Starting 150 worker threads.
答案 0 :(得分:2)
将其添加到文件的开头:
NameVirtualHost *:80
删除这些行:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
这些是apache提供的示例,应删除或注释。