8

I want to try mod_alias instead of mod_rewrite for a couple of simple redirect rules, but the directives don't seem to be working when entered in .htaccess. Is it possible that mod_alias is not loaded or enabled on the server?

How do I find out?

2 Answers 2

10

You can check if mod_alias is enabled by using the following command:

~$ apache2ctl -M | grep alias

If it's enabled, it will give you the following response:

 alias_module (shared)
Syntax OK

You can also check manually the file which is loading the module:

~$ cat /etc/apache2/mods-enabled/alias.load 

If it's enabled, it will give you the following response:

LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so
5
  • -bash: apache2ctl: command not found
    – Matthew S
    Jan 19, 2014 at 0:46
  • cat: /etc/apache2/mods-enabled/alias.load: No such file or directory
    – Matthew S
    Jan 19, 2014 at 0:46
  • -bash: LoadModule: command not found
    – Matthew S
    Jan 19, 2014 at 0:47
  • 1
    you can try httpd -M | grep alias Jan 19, 2014 at 0:48
  • httpd -M | grep alias Syntax OK alias_module (static) - Does that mean it's on?
    – Matthew S
    Jan 20, 2014 at 2:05
2

You can try listing all active modules with one of these:

apachectl -t -D DUMP_MODULES

or

httpd -M

Also, check if the module is commented out in the httpd.conf file:

cat /etc/httpd/conf/httpd.conf | grep LoadModule
2
  • Hi, Gabriel. I am getting '-bash: apachectl: command not found'. Nevermind, the 'httpd -M' command worked
    – Matthew S
    Jan 19, 2014 at 0:33
  • When running 'cat /etc/httpd/conf/httpd.conf | grep LoadModule' I am getting 'LoadModule bwlimited_module modules/mod_bwlimited.so'
    – Matthew S
    Jan 19, 2014 at 0:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .