ThinkingMonkey
ThinkingMonkey

Reputation: 12727

Why is my Named Based Virtualhost not working?

My virtual host configuration looks like this:

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 [email protected]
    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>

Although the localhost works, when I try to connect to the ServerName theag.com as described in the VirtualHost section, I get a Server not found. What am i doing wrong? or What am I supposed to do to get it it working?

p.s. ... signifies the configuration lines in between.

Workaround : For testing purposes this is what I have done:

I just edited the /etc/hosts, from
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
to
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 theag.com www.theag.com.
This will get it to work. You will be using the 127.0.0.1 as the ip-address for now.

Upvotes: 0

Views: 952

Answers (1)

David Schwartz
David Schwartz

Reputation: 182733

You have to arrange the domain's DNS to point to your server's IP address. If theag.com is the actual name, it's currently not associated with any IP address (neither is www.theag.com). Talk to the folks who manage your nameservers.

Upvotes: 2

Related Questions