I’m looking to run a Debian VPS as a web server. I’ve got Debian 6 installed, and I’ve got the default Apache 2 installation on there.

I’ve read a bit about how Apache 2 configuration is arranged slightly differently on Debian, and I just wanted to check I understand how Debian expects me to make my configuration changes to Apache.

My understanding is:

To add modules:

  • Install the module using apt-get
  • Enable the module using a2enmod

To add Virtual Hosts:

  • Create a separate configuration file for each virtual host (preferably named similarly to the virtual host’s intended domain name) in /etc/apache2/sites-available/
  • Enable the site using the a2ensite command

 To do anything else:

  • Create a separate configuration file for each configuration task in /etc/apache2/conf.d/. All files in this directory are included by default.

I’m basing this on http://www.control-escape.com/web/configuring-apache2-debian.html, and /usr/share/doc/apache2.2-common/README.Debian.gz.

Am I understanding this correctly? I’m guessing that editing e.g. apache2.conf directly isn’t a good way to add my own configuration settings, as my changes could be blitzed by an update in the future?

link|improve this question
Not a real question? No comments or edits to suggest how it might be improved? Cheers, very friendly. – Paul D. Waite Mar 23 '11 at 22:47
if you were to edit apache2.conf, your changes would not be 'blitzed on update' since, because the apache2.2-common declares apache2.conf as a conffile, dpkg would preserve your changes upon upgrade. However, httpd.conf is a better place to override stuff from apache2.conf so that apche2.conf can be 'blitzed' in the future. – stew Mar 23 '11 at 23:23
@stew: ah, gotcha. – Paul D. Waite Mar 24 '11 at 0:14
feedback

closed as not a real question by Scott Pack, Zypher Mar 23 '11 at 18:00

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. See the FAQ for guidance on how to improve it.

2 Answers

up vote 2 down vote accepted

Yes it's right. Completely right.

link|improve this answer
feedback

That looks correct to me. The website you reference seems accurate for the Debian configuration environment.

link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.