Configurar Apache Proxy RHEL 6
Utilización de proxy, se utiliza el proxy como un intermediario que recibe las peticiones de los clientes y las redirije a sus respectivos servidores. Esto con el objetivo que el servidor que se
exponga a una red externa sea el proxy y no los servidores reales. Tambien la ventaja del proxy es que ahorra el trabajo de estar creando reglas en el firewall para redireccionamiento de los servidores.
Ejemplo de uso de arquitectura
Siguiendo los pasos de la documentación de Red Hat para Apache (http://goo.gl/QPxr2v), se realizo lo siguiente:
1- Se instalo httpd desde el respositorio
[]# yum install httpd
2- Se modifico el archivo httpd ubicado en /etc/httpd/conf/httpd.conf agregando al final del documento las siguientes lineas:
<VirtualHost *:80>
# Your domain name
ServerName <IP>
ProxyPreserveHost On
# The IP and port of the JBoss Enterprise Application Platform
# These represent the default values, if your HTTPD is on the same host
# as your JBoss Enterprise Application Platform managed domain or server
ProxyPass / http://<IP>:8080/ retry=0 timeout=5
ProxyPassReverse / http://<IP>:8080/
# The location of the HTML files, and access control information
DocumentRoot /var/www
<Directory /var/www>
Options -Indexes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# Your domain name
ServerName <IP>
ProxyPreserveHost On
# The IP and port of the JBoss Enterprise Application Platform
# These represent the default values, if your HTTPD is on the same host
# as your JBoss Enterprise Application Platform managed domain or server
ProxyPass / http://<IP>:8080/ retry=0 timeout=5
ProxyPassReverse / http://<IP>:8080/
# The location of the HTML files, and access control information
DocumentRoot /var/www
<Directory /var/www>
Options -Indexes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Donde se tiene que reemplazar <IP> por el numero de IP del sevidor donde se esta ejecutando Apache.
3- Se ejecuto el siguiente comando para permitir las conexiones httpd (http://goo.gl/iwIYZG)
[]# /usr/sbin/setsebool httpd_can_network_connect 1
Con este comando el apache proxy funciona correctamente.
No hay comentarios:
Publicar un comentario