I can't get wordpress permalinks working on my Fedora LAMP server and expect it's due to mod_rewrite issue, but I can't figure out

  1. How do I check if mod_rewrite exists/is enabled?
  2. How do I install it (yum?) if it's not?

Any help appreciated. Thanks-

link|improve this question

67% accept rate
does "apachectl -l" list mod_rewrite.c ? if so, it was compiled in. – stew Mar 24 '11 at 18:10
@stew- no it doesn't. All it lists are core.c, prefork.c, http_core.c, and mod_so.c. So does that mean I have to recompile? That scares me- is there another way? – Yarin Mar 24 '11 at 18:14
no, it still can be added as a module, this just means it wasn't compiled in directly – stew Mar 24 '11 at 18:22
feedback

3 Answers

up vote 3 down vote accepted

mod_rewrite is already included in the httpd package, and is loaded in the default configuration. Use the RewriteEngine directive to enable it as required.

link|improve this answer
@Ignacio- Thanks, can you tell me exactly where and how it goes? Just anywhere in httpd.conf like: "RewriteEngine on" ? – Yarin Mar 24 '11 at 18:30
The best thing to do is to check the Context tag in the documentation. That will tell you where the directive can be used. httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteengine – Ignacio Vazquez-Abrams Mar 24 '11 at 18:33
Looks like mod_rewrite was indeed enabled, and I didn't need theRewriteEngine directive- Thanks for the help though- – Yarin Mar 27 '11 at 13:38
feedback
# a2enmod rewrite

Does it help?

link|improve this answer
that would help with debian (and ubuntu and other derivatives) but not likely on fedora – stew Mar 24 '11 at 18:23
feedback

If you installed apache from your distribution then it almost certainly included mod_rewrite, it's just not being loaded. If you're on a debian-based distribution use a2enmod rewrite to enable it, otherwise you'll need to find the

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

(or something similar) line in your httpd.conf file and uncomment it.

If you built apache by hand, then assuming you also built mod_rewrite as a module, the httpd.conf fix applies to you, but if you didn't build mod_rewrite into apache and didn't build it as a module, you're going to have to recompile.

link|improve this answer
@DerfK- It's fedora, and "LoadModule rewrite_module modules/mod_rewrite.so" already exists... – Yarin Mar 24 '11 at 18:52
feedback

Your Answer

 
or
required, but never shown

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