Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been configuring Apache and PHP, and the default config files have a ton of commented-out options, many of which I doubt I'll ever use.

After saving the default file as a backup and tweaking my config to perfection, I thought I might go through and delete most the commented-out lines, to make my config files shorter and more readable.

What's the conventional wisdom on this?

share|improve this question
up vote 4 down vote accepted

If I start with the default config I generally leave them in. If I want a cleaner config, which is usually a lot easier to read, I'll rename the default one and build a new one from scratch. That way I can still view the original comments if I later find I need to add some functions or features.

share|improve this answer

Personally I leave them in. A lot of the time, the commented-out directives have their defaults explicitly specified plus a brief description of the purpose and possible values for their field. Makes finding the right words for google searches much faster sometimes.

In general, my theory is that eventually I'll put them in a revision control of some sort so that I can do diffs between what's running and what came with the system so I can quickly see what I changed.

share|improve this answer

I delete the stuff I don't need; it's distracting and annoying. I will, on the other hand, liberally comment my config files with the intent of my configuration, and also links to internal and upstream documentation regarding the configuration (the authoritative reference for the configuration file directives, and any design docs we might have about the machine in question).

share|improve this answer

Make a copy of the original one and call it program.conf.orig or .default , then strip out the comments using egrep -v "^#|^$" program.conf.orig > program.conf and you're left with the actual configuration. If I ever need to reference comments in the original config, I have it there. Also that file then goes into a version control system (pick your poison)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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