我正在尝试让Apache虚拟主机与Amazon实例一起工作。我的httpd.conf如下所示
ServerName <elastic_ip>:80
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/sites/site1
ServerName www.site1.com
</VirtualHost>在这里,elastic_ip大致就像亚马逊土地上的静态IP。我的问题是网站没有正确加载。例如,当我在浏览器地址栏中键入以下内容时:
EC2-public-dns .... this works and loads the virtual host site
www.EC2-public-dns .... this doesn't load and gives "The requested URL could not be retrieved", i.e. not any default page
elastic-ip .... same as above
www.elastic-ip .... same as above我在/etc/host文件中没有任何内容,也许我应该这样做?对我做错了什么有什么想法吗?
更新:这是我的背景在高爸爸现在。
DNS Manager: Available
A @ el.as.tic.ip
CNAME www site1.com
CNAME ec2-XX-XX-XX-XX.eu-west-1.compute.amazonaws.com @发布于 2011-09-12 11:53:15
您正在使用基于名称的虚拟主机。这要求您有一些方法将www.site1.com名称映射到实例的弹性IP地址。您可以使用主机文件来完成这个任务,但是它只能从实例本身访问。通常,您会安排将DNS、一个或CNAME记录解析为您的实例的弹性IP地址,以获取您希望服务器提供的名称。
www.site1.com. CNAME site1.com.
site1.com. A el.as.tic.iphttps://serverfault.com/questions/310438
复制相似问题