Apache mod_proxy in Ubuntu
Setting up a reverse proxy using Apache in Ubuntu:1. Install reverse_proxy module
sudo apt-get install libapache2-mod-proxy-html
2. Install libxml if it is not already installed.
apt-get install libxml2-dev
3. Load the modules in apache2.conf file
LoadModuleproxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModuleproxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModuleheaders_module /usr/lib/apache2/modules/mod_headers.so
LoadModuledeflate_module /usr/lib/apache2/modules/mod_deflate.so
LoadFile /usr/lib/libxml2.so
4. Say you want to forward all requests starting with /foo to http://moo.com then add the following to your apache2.conf file
ProxyPass /foo/http://moo.com/
5. Bounce Apache and you are good to go.
页:
[1]