What's wrong with my VirtualHost?

Posted by johnlai2004 on Server Fault See other posts from Server Fault or by johnlai2004
Published on 2010-04-15T16:14:13Z Indexed on 2010/04/15 16:23 UTC
Read the original article Hit count: 398

Filed under:
|

I have the following VirtualHost

// filename: /etc/apache2/sites-available/ccbbbcc

<VirtualHost 1.1.1.1:80>
     ServerAdmin [email protected]
     ServerName ccbbbcc.com
     ServerAlias www.ccbbbcc.com
     DocumentRoot /srv/www/ccbbbcc/production/public_html/
     ErrorLog /srv/www/ccbbbcc/production/logs/error.log
     CustomLog /srv/www/ccbbbcc/production/logs/access.log combined
</VirtualHost>

And then I also have

//filename: /etc/apache2/sites-available/default

<VirtualHost 1.1.1.1:80>
ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
blah blah blah

How come when I type into my browser http://1.1.1.1, it takes me to http://ccbbbcc.com ? Even when I point new urls to the IP 1.1.1.1, webpages serve from http://ccbbbcc.com. Why is the ccbbbcc.com overriding all my other virtual hosts? Why am I unable to serve pages from /var/www directory?

I've made sure to use a2ensite and to restart apache.

This is what my /etc/apache2/ports.conf looks like

NameVirtualHost 1.1.1.1:80
Listen 80
Listen 443

© Server Fault or respective owner

Related posts about apache2

Related posts about virtualhost