What's wrong with my VirtualHost?
- by johnlai2004
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