Johnny Titanium (vaxocentric) wrote in apache,
  • Music: Dido - Worthless

How do I enable mod_proxy on Apache2 in linux

i think i'm the only person that ever posts here. ;)

again, i'm new to apache under linux, so this may be elementary...

how exactly do I enable mod_proxy in Apache2? I'm pretty certain I compiled it properly, but I get Invalid command 'RewriteEngine' in the error log from my [previously working on win32 apache] .htaccess file. I am presuming this is because mod_rewrite is not enabled.

I thought [though retrospectively incorrectly] that if I compiled Apache with --enable-MODULE it would automatically enable those modules. Is there something else I need to do?

Here's my ./configure script -- does it look right?
./configure -prefix=/usr/local/apache2 \
--enable-module=so \
--enable-module=auth_db \
--enable-module=digest \
--enable-module=example \
--enable-module=log_agent \
--enable-module=mime_magic \
--enable-module=usertrack \
--enable-module=auth_anon \
--enable-module=auth_digest \
--enable-module=cern_meta \
--enable-module=expires \
--enable-module=proxy \
--enable-module=unique_id \
--enable-module=vhost_alias \
--enable-module=auth_dbm \
--enable-module=headers \
--enable-module=info \
--enable-module=log_referer \
--enable-module=mmap_static \
--enable-module=speling \
--enable-module=rewrite


Thanks so much!
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded  

  • 8 comments

tmtl

January 7 2005, 07:30:52 UTC 8 years ago

Which do you mean? mod_proxy or mod_rewrite?

First off, check that mod_proxy is compiled in:
$ apachectl -l
Compiled in modules:
core.c
mod_proxy.c
proxy_connect.c
proxy_ftp.c
proxy_http.c

prefork.c
http_core.c
mod_so.c


Also, check what modules you're loading dynamically:
$ grep LoadModule /usr/local/etc/apache2/httpd.conf
LoadModule access_module libexec/apache2/mod_access.so
[...]
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
[...]


It sounds like you want to use mod_rewrite, but you've either not loaded it, or not allowed the overrides in .htaccess

vaxocentric

January 7 2005, 13:02:45 UTC 8 years ago

it looks like it didn't compile:

[vax@localhost bin]# ./apachectl -l
Compiled in modules:
core.c
mod_access.c
mod_auth.c
mod_include.c
mod_log_config.c
mod_env.c
mod_setenvif.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_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_so.c
[vax@localhost bin]# grep LoadModule ../conf/httpd.conf
LoadModule php5_module modules/libphp5.so
[vax@localhost bin]#


but i thought that having --enable-module=rewrite in ./configure would force it to compile.

i've certainly got the source files:
/install/httpd-2.0.52/modules/mappers/mod_rewrite.exp
install/httpd-2.0.52/modules/mappers/mod_rewrite.h
/install/httpd-2.0.52/modules/mappers/mod_rewrite.c
/install/httpd-2.0.52/modules/mappers/mod_rewrite.dsp


looking at the install output i captured, i see:
[vax@localhost httpd-2.0.52]# ./configure -prefix=/usr/local/apache2 \
> --enable-module=so \
> --enable-module=auth_db \
> --enable-module=digest \
> --enable-module=example \
> --enable-module=log_agent \
> --enable-module=mime_magic \
> --enable-module=usertrack \
> --enable-module=auth_anon \
> --enable-module=auth_digest \
> --enable-module=cern_meta \
> --enable-module=expires \
> --enable-module=proxy \
> --enable-module=unique_id \
> --enable-module=vhost_alias \
> --enable-module=auth_dbm \
> --enable-module=headers \
> --enable-module=info \
> --enable-module=log_referer \
> --enable-module=mmap_static \
> --enable-module=speling \
> --enable-module=rewrite
checking for chosen layout... Apache

.....

checking whether to enable mod_proxy... no
...
checking whether to enable mod_speling... no
checking whether to enable mod_userdir... yes (default)
checking whether to enable mod_alias... yes (default)
checking whether to enable mod_rewrite... no
checking whether to enable mod_so... yes


so, some of the modules i specified are enabled, some are not... does it compile them and just not enable them?

tmtl

January 8 2005, 08:11:45 UTC 8 years ago

Try using --enable-proxy rather than --enable-module=proxy

sjthespian

January 7 2005, 09:12:06 UTC 8 years ago

Without knowing more about what you are trying to do, it's hard to make more than a guess at your problem.

Someone else alreayd gave you the commands to see what modules are compiled in and in your config so I won't repeat those, but make sure you have both the proxy *and* the rewrite modules loaded. You might also need proxy_http_module if you are doing any URL rewriting.

vaxocentric

January 7 2005, 14:04:55 UTC 8 years ago

i know my rewriterules work. i'm trying to setup apache2 on linux w/ mod_rewrite support.

i think the problem is that i'm not setting the configure parameters correctly (or i'm failing to include dependencies). i'll look at the proxy_http module and see if its something i need.

but first step's first -- try to get mod_rewrite compiled with apache! (see previous thread for details)

thanks for your help!

vaxocentric

January 7 2005, 20:45:31 UTC 8 years ago

mod_rewrite.so was compiled and it resided in apache2/modules but it was not compiled in with the server, but rather just as a DSO (i think that's right), so I had to LoadModule it explicitly, along with:

LoadModule info_module modules/mod_info.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module modules/libphp5.so


everything else was built in. why it didn't do it with mod_info and mod_rewrite, i have no clue. if anybody knows, i'd love to hear it.

thanks everybody for your help -- your inquiries pointed me in the right direction.

Suspended comment

Suspended comment