Newly added virtualhost not working, domain points to /var/www/

apache-2.2virtualhost

I've had no problem with vhosts before, but for some reason this one isn't pointing to the right document root. The domain is pointing to the correct IP, apache sees no errors with the config file in sites-available, yet it just isn't pointing correctly.

Here is the vhost config for the domain:

<VirtualHost *80>
    ServerAdmin admin@mydomain.info
    ServerName mydomain.info
    ServerAlias www.mydomain.info

    DirectoryIndex index.html
    DocumentRoot /var/www/vhosts/mydomain.info/htdocs

    LogLevel warn
    ErrorLog /var/www/vhosts/mydomain.info/log/error.log
    CustomLog /var/www/vhosts/mydomain.info/log/access.log combined
</VirtualHost>

For the record, I am running Apache2 on Ubuntu 12.10

Best Answer

It sounds like you forgot to enable the site

a2ensite mydomain.info

Also, if the code above is an exact copy of your vhost definition then you'll need to change the first line to

<VirtualHost *:80>

otherwise you'll get an error

[Sun Nov 04 08:03:23 2012] [error] (EAI 5)No address associated with hostname: Could not resolve host name *80 -- ignoring!

Related Topic