tags:

views:

1529

answers:

1

I see that there's the 000-default virtual host and I left it. I created a new file and link for mysite.com and it works, but not how I want it to. I'm wondering, does anyone know if I need to delete or if I shouldn't delete the 000-default vh?

For some reason if to go to http://mysite.com it takes me to the 000-default site, but if I go to http://www.mysite.com it takes me to the correct place. Why is there a difference?

This is mysite.com vh file:

#NameVirtualHost *
<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName mysite.com
        ServerAlias www.mysite.com *.mysite.com
        DocumentRoot /home/nick/www/mysite.com

        ErrorLog /var/log/apache2/mysite.com/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel info

        CustomLog /var/log/apache2/mysite.com/access.log common
        ServerSignature On

</VirtualHost>
A: 

Configured like that, there is no need for default VH. Now, why mysite.com takes you to default? That's a good question, if your configuration is exactly as you've copied, you have restarted the server, then it shouldn't.

vartec
Well, possibly because of the default-000 file which I haven't shown? It is perfectly safe to delete the 000-default then?
Nick
ok, here how I got it to work...After deleting the 000-default link, I then had to uncomment #NameVirtualHostThanks.
Nick

related questions