I have the following VirtualHost
// filename: /etc/apache2/sites-available/ccbbbcc <VirtualHost 220.127.116.11:80> ServerAdmin firstname.lastname@example.org 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 18.104.22.168: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://22.214.171.124, it takes me to http://ccbbbcc.com ? Even when I point new urls to the IP 126.96.36.199, webpages serve from http://ccbbbcc.com. Why am I unable to serve pages from /var/www directory?
Additional symptoms - the ccbbbcc vhost overrides only SOME of my other vhosts. Not all.
I've made sure to use a2ensite and to restart apache.
This is what my /etc/apache2/ports.conf looks like
NameVirtualHost 188.8.131.52:80 Listen 80 Listen 443
I made a file called /srv/www/ccbbbcc/production/public_html/test.html with the text "Hello World". When I type http://ccbbbcc.com/test.html, the page loads fine. When I type http://184.108.40.206/test.html, I get a 404 Page Not Found. When I type http://220.127.116.11/, the web browser refreshes and then displays the url http://ccbbbcc.com. I then append test.html to the end of the url, and the Hello World shows up again.
So does that mean there's an http redirect happening somewhere? If so, I can't seem to determine what's causing it.
Also, i notice ccbbbcc overrides SOME of my virtualhosts, not ALL. There doesn't seem to be a pattern to which vhost is discriminated/overridden.
I also noticed that if I do the following
1. a2dissite ccbbbcc 2. /etc/init.d/apache2 reload 3. a2ensite ccbbbcc 4. /etc/init.d/apache2 reload
Then all of a sudden, http://ccbbbcc.com serves pages from /var/www/, and http://18.104.22.168 also serves pages from /var/www. How come the a2ensite/a2dissite of affects where pages are loaded from? The only way to make ccbbbcc serve pages from /srv/www/cbs/production again is to reboot my entire linux server! What's going on?