jueves, 8 de agosto de 2013

Proxy Reverso para Glassfish con Apache

Ya he explicado como hacer un reverse proxy en el anterior post:

http://www.redes-seguridad.com.ar/2013/08/reverse-proxy-con-apache-2-en-debian.html


Pero con Glassfish no me funcionaba así que habilité el módulo  "rewrite":

# a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!


Reiniciamos apache:

# /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .


Editamos la config del apache:

# vim /etc/apache2/httpd.conf

 ProxyPreserveHost on
 RewriteEngine on
 ProxyPass /glassfish http://mi_glassfish.com.ar:8080/
 ProxyPassReverse /crp http://mi_glassfish.com.ar:8080/
 Redirect / http://mi_glassfish.com.ar:8080/
 RewriteRule ^/(.*) mi_glassfish.com.ar:8080/$1 [P,L]


Reiniciamos apache:

# /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .


Fuente: http://czetsuya-tech.blogspot.com.ar/2012/07/how-to-port-forward-apaches-80-to.html#.UfkTqvkyaN1


No hay comentarios: