Apache服务器无法在单个公用IP上承载多个域错误:“未找到请求的URL /在此服务器上未找到。”

问题描述:

Apache服务器无法承载单公网IP上运行多个域的Windows Server 2016年Apache服务器无法在单个公用IP上承载多个域错误:“未找到请求的URL /在此服务器上未找到。”

错误:“未找到所请求的URL /没有被此服务器上找到。” 404未找到

进展到目前为止:

1)被修改的Windows主机文件 “C:\ Windows \ System32下\驱动程序\等\主机”:下面

127.0.0.1  localhost 
::1    localhost 
127.0.0.1  koffeeroasters.com 

2)的变化由在阿帕奇的httpd.conf文件低于

改变

#Include conf/extra/httpd-vhosts.conf 

Include conf/extra/httpd-vhosts.conf 

也改变

#LoadModule rewrite_module modules/mod_rewrite.so 

LoadModule rewrite_module modules/mod_rewrite.so 

,并添加到文件的末尾以下

# Tells Apache to identify which site by name 
NameVirtualHost *:80 
# Tells Apache to serve the default WAMP Server page to "localhost" 
<VirtualHost 127.0.0.1> 
ServerName localhost 
DocumentRoot "C:/wampstack/apache2/htdocs" 
</VirtualHost> 
# Tells Apache to serve Client 1's pages to "client1.localhost" 
# Duplicate and modify this block to add another client 
<VirtualHost 127.0.0.1> 
# The name to respond to 
ServerName koffeeroasters.com 
ServerAlias www.koffeeroasters.com 
# Folder where the files live 
DocumentRoot "C:/wampstack/apache2/htdocs/koffeeroasters.com/" 
# A few helpful settings... 
<Directory "C:/wampstack/apache2/htdocs/koffeeroasters.com/"> 

Order Allow,Deny 
Allow from all 
# Enables .htaccess files for this site 
AllowOverride All 
</Directory> 
# Apache will look for these two files, in this order, if no file is specified in the URL 
DirectoryIndex index.html index.php 
</VirtualHost> 

其他细节

我在bitnami wampstack上使用apache服务器。

从服务器浏览器输入地址“koffeeroasters.com”时,可以使用网站。

的一个原因吧,我知道没有(refered Apache的文档“https://httpd.apache.org/docs/2.4/vhosts/examples.html”)解决方案:对于那些要创建 Apache服务器上创建虚拟主机配置不会奇迹般地导致DNS条目:

注主机名称。您必须在DNS中拥有名称,解析为您的IP地址,否则其他人将无法看到您的网站。您可以将条目放入主机文件以进行本地测试,但只能从具有这些主机条目的计算机上使用。

谢谢你一堆。所有帮助赞赏。

尝试修改此:

<VirtualHost 127.0.0.1> 

<VirtualHost *:80> 

这意味着允许任何其他IP端口80上的连接,它应该让你去。试图匹配本地主机比你可能需要做得更多,除非你公开面对服务器,在这种情况下你不会想这样做。

+1

堆栈溢出说不谢谢,但我不能够感谢你。 –