What's wrong with my apache2 Vhost Config?

Associate
Joined
4 Mar 2007
Posts
315
Location
United Kingdom
Trying to host two sub domains on my server.
Interesting issue is sdomain 1 works fine, ping it, it works, content loads.
sdomain2 doesn't work. I've set the CNAME up for it as well 300s each. Nothing appearing on ping - vhost set up the same way.

Really quite confused. Any ideas?

Code:
<VirtualHost *:80>

        ServerAdmin [email protected]
        ServerName www.argentgray.com
        ServerAlias argentgray.com
        DocumentRoot /var/www/argentgray.com

        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/argentgray.com>
                AllowOverride All
                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 ${APACHE_LOG_DIR}/error.log
        #ErrorLog /var/www/sites/argentgray.com/log/error.log

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

        #CustomLog /var/www/sites/argentgray.com/log/access.log combined
        CustomLog ${APACHE_LOG_DIR}/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>

<VirtualHost *:80>

        ServerName dev.argentgray
        ServerAlias dev.*
		
        DocumentRoot /var/www/dev.argentgray.com
        ServerAdmin [email protected]

        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>

        <Directory /var/www/dev.argentgray.com>
                AllowOverride All
                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>

</VirtualHost>

<VirtualHost *:80>

        DocumentRoot /var/www/client.argentgray.com
        ServerName client.argentgray
        ServerAlias client.*

        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>

        <Directory /var/www/client.argentgray.com>
                AllowOverride All
                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>

</VirtualHost>
 
Check the error logs for the non functioning site and wait a little longer for the subdomain to be picked up. I don't think I have ever seen the TTL actually make a blind bit of difference when I change it.
 
If it doesn't ping, it's a DNS issue, not an Apache issue.

Can you post your CNAME configuration EXACTLY how you have entered it? If you are using FQDN's, you must put a period ( . ) at the end of the .com, or whatever.

e.g

blah IN CNAME myfull.domainname.com.
 
Seemed to be a DNS related issue, got in contact with cloudflare. They apparently didn't release my name servers when I requested them to a while back.

All sorted now - thank god.

Cheers guys!
 
Back
Top Bottom