Default VirtualHost in Apache 2.2 won’t change

Ah, more problems configuring a 1and1 Dedicated Server. This time it was getting up the proper holding page I wanted for any unused domains. By “Unused” I mean domains that are pointed at the server but have no website attached to them and therefore have no VirtualHost container within httpd.conf.

I’ve read through the manual and various other tutorial sites several times and still couldn’t find where I was going wrong. Instead of getting my simple company branded holding page I got 1and1′s holding page (but hosted on my server). I eventually gave up on trying to re-write my httpd.conf and instead did a search for the text “http://www.oneandone.co.uk” which was contained within the HTML document used in the holding page. You can search the drive using:

grep -R “http://www.oneandone.co.uk” /var/www/*

Among a few other files the main one I noticed was a file contained in the /etc/httpd/conf.d folder containing the apache configuration for Pleask and since this is loaded into httpd before any of my directives, this was causing the VirtualHost container I had created as default to be overwriten by a Plesk one which is higher up the series of config files.

Since I don’t give a crap about Pleask I just moved the file out of the conf.d folder and restarted apache and all was fixed!