[英]Apache Server Unable to host multiple domain on single Public IP Error : “Not Found The requested URL / was not found on this server.”
Apache Server Unable to host multiple domain on single Public IP running on Windows Server 2016 Apache Server无法在Windows Server 2016上运行的单个公共IP上托管多个域
Error:"Not Found The requested URL / was not found on this server." 错误:“未在此服务器上找到请求的URL /”。 404 Not Found
找不到404
Progress so far : 到目前为止的进展:
1)Edited Windows hosts file "C:\\Windows\\System32\\drivers\\etc\\hosts": to below 1)编辑Windows主机文件“ C:\\ Windows \\ System32 \\ drivers \\ etc \\ hosts”:至以下
127.0.0.1 localhost
::1 localhost
127.0.0.1 koffeeroasters.com
2)Changes made in the httpd.conf file of apache is below 2)下面对apache的httpd.conf文件所做的更改
changed 变
#Include conf/extra/httpd-vhosts.conf
to 至
Include conf/extra/httpd-vhosts.conf
also changed 也改变了
#LoadModule rewrite_module modules/mod_rewrite.so
to 至
LoadModule rewrite_module modules/mod_rewrite.so
and added to the end of the file the following 并将以下内容添加到文件末尾
# 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>
Other details 其他详情
I am using apache server on bitnami wampstack. 我在bitnami wampstack上使用apache服务器。
Site is available when typed the address "koffeeroasters.com" from the servers browser. 在服务器浏览器中键入地址“ koffeeroasters.com”时,该站点可用。
A reason for it which I know no solution of (refered from apache docs " https://httpd.apache.org/docs/2.4/vhosts/examples.html ") : 我不知道解决方案的原因(请参阅apache docs“ https://httpd.apache.org/docs/2.4/vhosts/examples.html ”):
Note : Creating virtual host configurations on your Apache server does not magically cause DNS entries to be created for those host names. 注意:在Apache服务器上创建虚拟主机配置不会神奇地导致为这些主机名创建DNS条目。 You must have the names in DNS, resolving to your IP address, or nobody else will be able to see your web site.
您必须在DNS中输入名称,解析为IP地址,否则其他人将看不到您的网站。 You can put entries in your hosts file for local testing, but that will work only from the machine with those hosts entries.
您可以将条目放入主机文件中以进行本地测试,但这仅在具有这些主机条目的计算机上有效。
Thanks a bunch. 谢谢你 All help appreciated.
所有帮助表示赞赏。
Try changing this: 尝试更改此:
<VirtualHost 127.0.0.1>
to 至
<VirtualHost *:80>
This means allow any other IPs connect on port 80, which should get you going. 这意味着允许端口80上的任何其他IP连接,这应该会让您顺利进行。 Trying to match the localhost is doing more than you probably need, unless you are public facing server, in which case you will not want to do this.
尝试匹配localhost可能会做很多事情,除非您是面向公众的服务器,否则您将不希望这样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.