我的虚拟主机配置如下所示:
Listen 80
...
DocumentRoot "/www/mysite"
...
<Directory "/www/mysite">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
...
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
...
NameVirtualHost *:80
...
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
ServerName theag.com
ServerAlias www.theag.com
DocumentRoot "/www/mysite"
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>尽管本地主机可以工作,但当我试图连接到ServerName theag.com (如VirtualHost部分所述)时,我会得到一个Server not 。我做错什么了?或者我该怎么做才能让它起作用?
附注:...表示之间的配置行。
解决方案:为了测试目的,这就是我所做的:
我刚刚编辑了/etc/host,从
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
至
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 theag.com www.theag.com。
这会让它发挥作用的。现在,您将使用127.0.0.1作为ip地址。
发布于 2011-12-18 09:56:05
您必须安排域名的DNS指向您的服务器的IP地址。如果theag.com是实际名称,那么它目前与任何IP地址都没有关联(www.theag.com也不是)。和管理你同名者的人谈谈。
https://stackoverflow.com/questions/8550952
复制相似问题