All virtualhosts serving Apache default files
        Posted  
        
            by tj111
        on Server Fault
        
        See other posts from Server Fault
        
            or by tj111
        
        
        
        Published on 2010-05-22T18:13:09Z
        Indexed on 
            2010/05/22
            18:21 UTC
        
        
        Read the original article
        Hit count: 374
        
I'm trying to configure Apache as an in-network webserver, and am using the sites-available/sites-enabled feature as opposed to just static vhost files. I set up a couple VirtualHosts, all with a unique DocumentRoot, however request for all the VirtualHosts just serve up the "It's Working!" default file. I can't for the life of me figure out why it won't serve the content out of the correct directory. Here's the contents of the virtualhost directive files, let me know if I need to post more.
default (note that apache renames this to 000-default in sites-enabled, so it's not an ordering issue)
NameVirtualHost *:80
ServerName emp
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName emp
    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog /var/log/apache2/error.log
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>
billmed
<VirtualHost *:80>
    ServerName billmed.emp
    ServerRoot /home/empression/Projects/billmed/web/httpdocs
    <Directory "/home/empression/Projects/billmed/web/httpdocs">
        Order Allow,Deny
        Allow from All
    </Directory>
</VirtualHost>
Note that I have DNS zones for both emp and billmed.emp, as well as entries in /etc/hosts.  My ultimate goal is to set up this machine as an in-house webserver with a custom tld (emp), but progress has been pretty slow.
© Server Fault or respective owner