You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joe Hansen <jo...@gmail.com> on 2010/05/29 20:59:39 UTC

[users@httpd] How to enable mod_rewrite on an Apache 2.2 installation? mod_rewrite.so doesn't exist.

Hey All,

I've installed Apache 2.2.14 on our Redhat Enterprise Linux ES 5.0
box. I use it host a couple of websites and it runs great. :)

I now need to add some redirect rules on Apache.
For example, I need to:
1) redirect http://mywebsite.com to http://www.mywebsite.com
2) redirect /about.html to /page/10/
etc

I executed httpd -l and found out that mod_rewrite wasn't enabled.
There is no mod_rewrite.so file on my machine.

Given that, is there an easy way to enable mod-rewrite without having
to build Apache from scratch?
If I had to bulid Apache from scratch, the configuration files
(httpd.conf, httpd-vhosts.conf etc) would be rewritten, right?

Please advise. Thank you very much for your time!

Thanks,
Joe

PS:
Here's the output of "httpd -l" command:
core.c
mod_authn_file.c
mod_authn_default.c
mod_authz_host.c
mod_authz_groupfile.c
mod_authz_user.c
mod_authz_default.c
mod_auth_basic.c
mod_isapi.c
mod_include.c
mod_filter.c
mod_log_config.c
mod_env.c
mod_setenvif.c
mod_version.c
mod_proxy.c
mod_proxy_connect.c
mod_proxy_ftp.c
mod_proxy_http.c
mod_proxy_scgi.c
mod_proxy_ajp.c
mod_proxy_balancer.c
mod_ssl.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_so.c

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: How to enable mod_rewrite on an Apache 2.2 installation? mod_rewrite.so doesn't exist.

Posted by Joe Hansen <jo...@gmail.com>.
The following article helped me with this:
http://forum.ivorde.ro/apache-2-2-installation-of-mod-rewrite-module-without-recompiling-whole-apache-t67.html

Essentially, I located mod_rewrite.c and ran the following command:
apxs -c -i mod_rewrite.c

mod_rewrite.so is created.

Then, I added the following line to httpd.conf file
LoadModule rewrite_module modules/mod_rewrite.so

Then, I ran the following command to check if the configuration was fine:
apachectl configtest
Syntax OK

Finally, I restarted Apache. That's it.

Thanks,
Joe



On Sat, May 29, 2010 at 12:59 PM, Joe Hansen <jo...@gmail.com> wrote:
> Hey All,
>
> I've installed Apache 2.2.14 on our Redhat Enterprise Linux ES 5.0
> box. I use it host a couple of websites and it runs great. :)
>
> I now need to add some redirect rules on Apache.
> For example, I need to:
> 1) redirect http://mywebsite.com to http://www.mywebsite.com
> 2) redirect /about.html to /page/10/
> etc
>
> I executed httpd -l and found out that mod_rewrite wasn't enabled.
> There is no mod_rewrite.so file on my machine.
>
> Given that, is there an easy way to enable mod-rewrite without having
> to build Apache from scratch?
> If I had to bulid Apache from scratch, the configuration files
> (httpd.conf, httpd-vhosts.conf etc) would be rewritten, right?
>
> Please advise. Thank you very much for your time!
>
> Thanks,
> Joe
>
> PS:
> Here's the output of "httpd -l" command:
> core.c
> mod_authn_file.c
> mod_authn_default.c
> mod_authz_host.c
> mod_authz_groupfile.c
> mod_authz_user.c
> mod_authz_default.c
> mod_auth_basic.c
> mod_isapi.c
> mod_include.c
> mod_filter.c
> mod_log_config.c
> mod_env.c
> mod_setenvif.c
> mod_version.c
> mod_proxy.c
> mod_proxy_connect.c
> mod_proxy_ftp.c
> mod_proxy_http.c
> mod_proxy_scgi.c
> mod_proxy_ajp.c
> mod_proxy_balancer.c
> mod_ssl.c
> prefork.c
> http_core.c
> mod_mime.c
> mod_status.c
> mod_autoindex.c
> mod_asis.c
> mod_cgi.c
> mod_negotiation.c
> mod_dir.c
> mod_actions.c
> mod_userdir.c
> mod_alias.c
> mod_so.c
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org