apache2.4 bypass proxy

O bypass Proxy serve para você ter um servidor web principal e apontar as requisições para outros servidores, também serve para fazer load balance
Este manual foi desenvolvido baseado na versão 2.4 do apache

para configurar o bypass proxy:

apt-get install -y libapache2-mod-proxy-html libxml2-dev
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_html
a2enmod lbmethod_byrequests

crie o /etc/apache2/sites-available/proxy.conf

################################################
# http proxy #
################################################

ServerName NOME.DO.SITE.com.br

BalancerMember http://IP_DO_SITE:80 route=1
ProxySet stickysession=ROUTEID

ServerAdmin [email protected]
SetEnv proxy-initial-not-pooled 1

DocumentRoot /var/www/
LimitRequestLine 32768
ProxyRequests off
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/other_vhosts_access.log combined
LogLevel warn

ProxyPreserveHost On
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/


ServerName NOME.DO.SITE.com.br

BalancerMember http://IP_DO_SITE:80 route=1
ProxySet stickysession=ROUTEID

ServerAdmin [email protected]
SetEnv proxy-initial-not-pooled 1

DocumentRoot /var/www/
LimitRequestLine 32768
ProxyRequests off
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/other_vhosts_access.log combined
LogLevel warn

ProxyPreserveHost On
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/

## final do arquivo#############

Habilite a nova configuração:
a2ensite proxy

reinicie o apache

/etc/init.d/apache2 restart