而不是负面投票,如何告诉我为什么。 。 。
我已经设置了一个Web服务器,并在LAMP堆栈上上传了一些网页。我可以通过IP地址访问。我将我的域名主机设置为指向云dns。我启用了云DNA api。我的问题是域名没有加载网站,只返回"此网页不可用/ DNS查找失败"我已经阅读并尝试了很多不同的选择。没运气。其他信息:
sudo apache2ctl -S返回:
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server lamp-6kvi.c.united-yeti-790.internal (/etc/apache2/sites-enabled/lamp-server:1)
port 80 namevhost lamp-6kvi.c.united-yeti-790.internal (/etc/apache2/sites-enabled/lamp-server:1)
port 80 namevhost example.com (/etc/apache2/sites-enabled/lamp-server:28)
port 80 namevhost example.com (/etc/apache2/sites-enabled/example.com:1)
Syntax OK
配置文件/etc/apache2/sites-available/example.com读取:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/websitedirectory
<Directory /var/www/websitedirectory/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/mysite-error.log
CustomLog /var/log/apache2/mysite-access.log common
cloud dns managed-zone list返回:
[
{
"creationTime": "2014-12-14T15:40:29.066Z",
"description": "",
"dnsName": "example.com.",
"id": "2608871832699155245",
"kind": "dns#managedZone",
"name": "exampledns",
"nameServers": [
"ns-cloud-d1.googledomains.com.",
"ns-cloud-d2.googledomains.com.",
"ns-cloud-d3.googledomains.com.",
"ns-cloud-d4.googledomains.com."
]
}]
我没有尝试删除灯泡服务器,默认或注释掉其他文件。 。 。请帮忙。
答案 0 :(得分:1)
要扩展您自己的答案,(通过使用Web控制台),您应该:
您现在应该将 example.com 和 www.example.com 同时解析为同一个IP。你还需要保持:
ServerName example.com
ServerAlias www.example.com
在虚拟主机apache配置中。
希望它有助于澄清。
答案 1 :(得分:0)
让它工作 - 发现你需要&#34;添加记录集&#34;在将IP指向您的服务器时,为www.example.com和example.com键入a。像我的问题设置虚拟主机,但没有该部分。
希望有人能证实这是正确的方法。无论如何,使用相同的方法将另外4个域添加到同一服务器。 :-D