Rebuilding httpd.conf?

Hi All,
A brief rundown of my environment.

Have been playing with AWS for a while and loaded Virtualmin on a micro instance of Ubuntu 10.04. Despite the small footprint, Virtualmin runs great and I (was) running a few low-end sites on it without issue.

In any case, the shell kept complaining that the AMI was horrendously out of date and instead of firing up a new instance, I stupidly went the apt-get update/upgrade route.

For some reason the update re-wrote the httpd.conf file so now all my virtual sites point to /var/www instead of /home/*. If I try adding new sites, despite records being added to /etc/apache2/sites-available/enabled, Apache isn’t aware of this and keeps pointing to /var/www.

Unfortunately I’m a bit out of date with my Apache awareness, so I’m not entirely sure why this is happening, and how to restore the settings written by Virtualmin.

Any ideas would be appreciated!


This sounds a little odd… You’re using a “standard” Ubuntu 10.04 with no personal modifications? What is “AMI”?

I’m using the same system, and apt-get never overwrote any of Virtualmin’s Apache config files during updates. The main config file is named apache2.conf by the way, and not http.conf (though the latter also exists, with a few some custom lines).

The most important part in that regard is

# Include generic snippets of statements Include /etc/apache2/conf.d/

which includes all the sites/modules config files.

You hopefully have backups from which you can restore the config files?

Sorry - AMI = Amazon EC2 virtual container/instance.

I hadn’t backed anything up as this was more of a sandbox environment, but I’m about to start using it in anger so I thought a simple upgrade would be harmless.

Thanks for the tip - I checked the apache2.conf file and it the snippets statement was not commented out. It also had an include statement for:

# Include the virtual host configurations: Include /etc/apache2/sites-enabled NameVirtualHost IP1:80 NameVirtualHost IP2:80 NameVirtualHost IP2:443

Any ideas?


So just to update my own thread…

  • So when I try to go to, I’m shown the default index.html file in /var/www
  • Next I tried to re-enable the virtual host setting by issuing:

    sudo a2ensite
  • Apache said

    Site already enabled
  • Now when I try to resolve my site, it’s throwing a 404 - which is slightly good news because I guess it means it’s no longer looking in /var/www
  • Checking the error log, it says the 404 is being thrown because it can’t find /htdocs? Which is not in my sites conf file.

I know this is not a virtualmin problem - but just the same I’m really confused why a simple upgrade has caused so much havoc! Would re-installing Virtualmin help?

I’d recommend installing another Virtualmin in a separate container, and taking the apache2.conf file from there, copying it over and making the necessary adjustments. The file usually is pretty identical for all VM installations (except for some NameVirtualHost statements).

Since I use the same system, I could also paste mine for you to adapt and assimilate. :slight_smile:

And then it’d be interesting to know why updating overwrote your Apache config. This is something that should definitely not happen.