Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

What are the terminal commands used to enable and disable Apache2 modules?

Update: Since the commands appear to differ based on distribution, I have made this question a community wiki where hopefully each poster can indicate the commands they use along with the pertinent distributions in which they work.

share|improve this question
The commands are different on different distros. Ubuntu/Debian is different from CentOS/RHEL, which is different then FreeBSD, etc. Please add a tag to indicate what distro you are using. – Stefan Lasiewski Aug 21 '10 at 18:22
... just change the config ... – xenoterracide Aug 21 '10 at 19:03
If you're going to make the post CW, don't choose an answer. – gvkv Aug 21 '10 at 19:18
@gvkv - Fair enough. I removed the accepted answer. – Noah Goodrich Aug 21 '10 at 19:41
I don't want to sound like I'm scolding you, it's just that CW is for questions that can have no best answer. If you asked "What commands ... on Ubuntu ..." then feel free to choose the best. – gvkv Aug 21 '10 at 20:07

On debian / ubuntu you need to look at a2enmod and a2dismod. There are similar tools for toggling site configurations too (a2ensite and a2dissite).

share|improve this answer
I think a2enmod and a2dismod are on all platforms that carry apache. I can comfirm openSUSE at least – decriptor Aug 21 '10 at 17:36
@dec Gentoo doesn't have them, at least not automatically (there might be some package or useflag that includes them). This makes it sound like it's only Debian/Ubuntu and openSUSE – Michael Mrozek Aug 21 '10 at 17:43
CentOS 5.5 doesn't have them either, which probably also means RHEL 5 doesn't. I don't have easy access to any other distros though. – Matt Aug 21 '10 at 19:11

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.