I have an ubuntu with the the following config file:

<VirtualHost *:80>
    ServerName dev.domain.com
    DocumentRoot /data/sites/dev.domain.com/www/public

Other vhost files are being served correctly on this host. It is properly symlinked; the directory exists. Is there a reason why this is not working? I don't see anything in the standard apache server logs.


this is an ubuntu host and many other vhosts using the standard sites-available / sites-enabled are working. One issue is that it runs both mod_php and phusion mod_rails.

@Lain here's the output from a2ensite: jon@ve:/etc/apache2/sites-available$ sudo sudo a2ensite /etc/apache2/apache2.conf ERROR: No site found matching /etc/apache2/apache2.conf!

here's the output from apache2ctl -S (thx for this - I had always wondered how to to do this)

 jon@ve:/etc/apache2/sites-available$ /usr/sbin/apache2ctl -S
 VirtualHost configuration:
 wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server ve.vesrv.com (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost ve.vesrv.com (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost testfb.hex.com (/etc/apache2/sites-enabled/001-testfb:1)
         port 80 namevhost testfb2.hex.com (/etc/apache2/sites-enabled/002-testfb2:1)
         port 80 namevhost rails-dev.rtm.com (/etc/apache2/sites-enabled/018-rails-dev.rtm.com:1)
         port 80 namevhost dev.domain.com (/etc/apache2/sites-enabled/019-dev.domain.com:6)
Syntax OK
  • Is this your entire virtualhost container? Take a look at some of the other working vhosts, you are missing the location container. – Sean Kimball Sep 11 '11 at 15:04
  • What happens when you attempt to access dev.domain.com. Show us the output of /usr/sbin/apache2ctl -S. – Iain Sep 11 '11 at 16:55
  • 1
    If you don't see ANYTHING in your logs, are you sure that dev.domain.com has that server's IP? – DerfK Sep 11 '11 at 17:10

Add to the file, between <VirtualHost>...</VirtualHost>:

<Directory /data/sites/dev.domain.com/www/public>
    Order allow,deny
    allow from all

Make sure you have NameVirtualHost *:80 somewhere before this file is loaded. (You can stick it just before <VirtualHost *:80> to be sure.)

EDIT 2: Make sure you sudo a2ensite config_file config_file is the file that contains the <VirtualHost> block. Should be /etc/apache2/sites-available/dev.domain.com.conf and you should use sudo a2ensite dev.domain.com.conf

Make sure you sudo apahce2ctl restart


Regarding logs, not sure what your global conf is. You may need this within <VirtualHost>...</VirtualHost>:

    ErrorLog /var/log/apache2/dev.domain.com-error.log

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

    CustomLog /var/log/apache2/dev.domain.com-access.log combined

If you really have created a vhost called dev.domain.com then unless you have created your own DNS entry for it, it will not be resolving to your server so you won't see anything. It seems unlikely that you are the owner of domain.com so it's a not a good idea to be creating vhosts and DNS entries for it's sub domains yourself. Better to create a vhost and DNS entries for a domain that you control.

  • a DNS record has been created and it resolves correctly. It's currently showing the default apache site implying that there's something wrong with the apache configuration – timpone Sep 11 '11 at 17:28
  • Did you try a full restart sudo apache2ctl restart ? – xofer Sep 11 '11 at 17:39
  • yep, restarted, rebooted computer, everything... sorry, I know this is probably something REALLY stupid. I think it might be something with phusion passenger – timpone Sep 11 '11 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.