24

I'm having trouble getting Proxying working in Apache 2.2

When I try to start it, I get an Invalid command 'ProxyPass' error. that would be indicative of proxy_http_module not being loaded. However when I look at the debug, it seems to be there. e.g.,

E:\Apache\bin>httpd -e debug
[Fri Aug 21 15:48:55 2015] [debug] mod_so.c(246): loaded module actions_module
...
[Fri Aug 21 15:48:55 2015] [debug] mod_so.c(246): loaded module proxy_ajp_module
[Fri Aug 21 15:48:55 2015] [debug] mod_so.c(246): loaded module proxy_http_module   <-----
[Fri Aug 21 15:48:55 2015] [debug] mod_so.c(246): loaded module setenvif_module
....
[Fri Aug 21 15:48:55 2015] [debug] mod_so.c(246): loaded module jk_module
[Fri Aug 21 15:48:55 2015] [notice] Disabled use of AcceptEx() WinSock2 API
Syntax error on line 84 of E:/Apache/conf/extra/httpd-ssl.conf:
Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included
in the server configuration

So it looks to me that proxy_http_module is loading. I don't understand why it doesn't know what ProxyPass is.

I've certainly turned it on in my httpd.conf file

#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.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     # <--------------
#LoadModule rewrite_module modules/mod_rewrite.so

Note: I am trying to do this through an SSL connection so I'm loading httpd-ssl.conf as well later on in my httpd.conf file

<IfModule ssl_module>
Include conf/extra/httpd-ssl.conf
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

Then in httpd-ssl.conf I've set up a VirtualHost entry

<VirtualHost _default_:443>
    DocumentRoot "E:/Apache/htdocs"
### dummy IP
    ServerName 127.12.34.56:443
    ServerAdmin me@example.com
    ErrorLog "E:/Apache/logs/error.log"
    TransferLog "E:/Apache/logs/access.log"

    #ProxyRequests Off
### It chokes on the following entry
    ProxyPass / http://myfirewalledserver:80/
    #ProxyPassReverse / http://myfirewalledserver:80/
</VirtualHost>                                  

What have I missed here?

BIBD
  • 1,826
  • 10
  • 29
  • 44
  • 1
    *proxy_http* module requires *proxy*, and *ProxyPass* directive is defined in the latter. Just to be sure: is it also loaded? – sam_pan_mariusz Aug 21 '15 at 21:31
  • much better... thank you... if you want to add that as an answer I'll accept it post haste. – BIBD Aug 21 '15 at 21:33

1 Answers1

37

proxy_http module requires proxy, and ProxyPass directive is defined in the latter.

Make sure it's also loaded.

Thanks to Milind Singh

Load the module by running

Run sudo a2enmod proxy_http
Dave M
  • 4,494
  • 21
  • 30
  • 30
sam_pan_mariusz
  • 2,053
  • 1
  • 12
  • 15