8

How can enable and load mod_proxy_http?

I have XAMPP, and I want to enable mod_proxy_http

I can see the module XAMPP/apache/modules/mod_proxy_http.so but I don't see any commanted module directives to uncomment in file XAMPP/apahce/conf/httpd.comf

I have restarted the server and I see the module has not loaded through phpinfo()

How can enable and load mod_proxy_http?

IberoMedia
  • 203
  • 2
  • 3
  • 8

1 Answers1

10

You should have lines similar to this in your httpd.conf:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

Which enable the modules in question. With the module enabled, you'll want to add configuration on how you're wanting to use mod_proxy. There's example configurations located here. Be sure to also follow the recommendations in the security area.

<Proxy *>
  Order Deny,Allow
  Deny from all
  Allow from 192.168.0
</Proxy>

If you're configuring a reverse proxy, it's recommended to implement the paths in the relevant virtual host code blocK.

ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar
Andrew Ty.
  • 281
  • 2
  • 5
  • How do I enable the module? – IberoMedia Apr 18 '13 at 18:10
  • Updated my answer to include that. – Andrew Ty. Apr 18 '13 at 18:14
  • 1
    And restart Apache to get it all to work. – Giacomo1968 Apr 18 '13 at 18:20
  • @Andrew Ty. I have made the changes you indicate. However, of all the modules you list, if I enable mod_proxy_balancer Apache won;t start and I get this error "[Thu Apr 18 12:20:39.270326 2013] [proxy_balancer:emerg] [pid 12188:tid 252] AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded?? [Thu Apr 18 12:20:39.270326 2013] [:emerg] [pid 12188:tid 252] AH00020: Configuration Failed, exiting" But if I disable this only one module Apache starts. Can I do w/o this module? – IberoMedia Apr 18 '13 at 19:23
  • 1
    Definitely, I just grepped mod_proxy from my httpd.conf to show you the various modules. Infact, you can leave all but `mod_proxy` and `mod_proxy_http` disabled for the purposes you've shown thus far.. – Andrew Ty. Apr 18 '13 at 20:20
  • @IberoMedia add this line to httpd.conf : LoadModule slotmem_shm_module modules/mod_slotmem_shm.so – user889030 May 08 '19 at 09:23