# problem getting mod_proxy_html working [SOLVED]

## redwood

Hi,

I have a small private network 192.168.1.0/24 sitting behind an ADSL-modem/router with a single dynamic IP which I've registered using dyndns.com which forwards port 8080 to my main Gentoo64 amd64 Server (S64) and port 443

to another 32-bit PentiumIII Server (S32) running a commercial 32-bit web-application licensed for that cpu.

I'd like to setup a forward/reverse proxy for apache using mod_proxy_html and have my router forward http/https

ports to my main S64 server which would then rewrite the requests as appropriate.

I've added the directive "-D PROXY_HTML" to $APACHE2_OPTS in /etc/conf.d/apache2

Yet when I try to start apache2 with mod_proxy_html syntax (e.g. ProxyPass, ProxyRequests, etc.) I get

startup errors:

#cat /var/log/apache2/startuperror.log

Syntax error on line 89 of /etc/apache2/vhosts.d/vhosts.conf:

Invalid command 'ProxyRequests', perhaps mis-spelled or defined by a module not included in the server configuration

I've tried both *2.4.3 and (~)2.5.1 versions of mod_proxy_html to no avail.

I'm running apache2:

#eix net-www/apache

[I] net-www/apache

     Available versions:

        (1)     1.3.34-r14 (~)1.3.37

        (2)     2.0.58-r2 (~)2.0.59-r2 [M](~)2.2.4

     Installed versions:  2.0.59-r2(2)(17:41:22 04/02/07)(apache2 debug -doc -ldap -mpm-itk -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool mpm-worker -selinux ssl -static-modules threads)

A portion of my /etc/apache2/vhost.d/vhosts.conf file 

<VirtualHost *:443>

        UseCanonicalName off

        ServerName      app1.mydomain.net

        Redirect / https://S32.mydomain.net:443/cgi-bin/app1/app1_login

        ErrorLog /var/log/apache2/app1-error

        CustomLog /var/log/apache2/app1-access combined

       ProxyRequests off

       ProxyPass /app1/ https://S32.mydomain.net:443/

       ProxyHTMLURLMap https://S32.mydomain.net:443 /app1

       <Location /app1/>

               ProxyPassReverse /

               SetOutputFilter  proxy-html

               ProxyHTMLURLMap  /         /app1/

               ProxyHTMLURLMap  /app1  /app1

               RequestHeader    unset  Accept-Encoding

       </Location>

</VirtualHost>

I've got the following in /etc/apache2/httpd.conf

# grep "LoadModule proxy" /etc/apache2/httpd.conf

    LoadModule proxy_module                  modules/mod_proxy.so

    LoadModule proxy_connect_module          modules/mod_proxy_connect.so

    LoadModule proxy_ftp_module              modules/mod_proxy_ftp.so

    LoadModule proxy_http_module             modules/mod_proxy_http.so

THANKS for any ideas on getting mod_proxy_html functioning.

[SOLVED]

I needed two Directives in my /etc/conf.d/apache2

APACHE2_OPTS="$APACHE2_OPTS -D PROXY -D PROXY_HTML"

----------

## Varsuuk

I had a working Apache on my prior incarnation of my server (I still have the old drive mounted for comparison) but now get the error you listed.

I only had "-D PROXY" but after reading this added "-D PROXY_HTML" as well.

I also tried a Make.conf change to APACHE2_MODULES+="proxy proxy_connect proxy_ftp proxy_http" (these do NOT seem to be reflected when I did an emerge -av apache. They still list with "-" in front of name.

I also do not see the actual so's in the module directories.

Any clues? Advice?

----------

## redwood

Did you remember to

emerge www-apache/mod_proxy_html ?

----------

## Varsuuk

 *redwood wrote:*   

> Did you remember to
> 
> emerge www-apache/mod_proxy_html ?

 

No... why do you ask?

/whimper

/blush

(In my defense, I was trying to configure the new pc from the old setup and forgot how I ever setup Apache to begin with about 1-2 years ago.)

Btw... I know I used a 'howto' or something on setting it up. One of the sources was the apache docs on proxying, that's where I learned about it - but there was an emerge-gentoo-specific one as well, I THOUGHT... but don't see it now:(

I'll post if this is it when I get home from work - I'm sure it is  :Wink:  THANKS!

----------

## Varsuuk

No, couldnt emerge that as it was masked (amd64) - I decided to open a new thread since it wasn't a simple answer and wanted no one to ignore it due to solved marker  :Wink: 

https://forums.gentoo.org/viewtopic-t-667799.html

----------

