Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

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. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the 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

2 Answers 2

up vote 2 down vote accepted

Yes it's right. Completely right.

share|improve this answer

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

share|improve this answer

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