How to Port Forward Apache's 80 to Glassfish's 8080 Using Proxy Configuration
Recently, I'm developing and testing an application deployed on Glassfish that runs on port 8080. Then I do need the app to run on port ...

1.) Make sure that you have download, installed and configured Glassfish to run on port 8080. (Just need to download the zipped file from oracle: http://glassfish.java.net/downloads/).
2.) Download, installed and configured apache on port 8080.
sudo apt-get install apache2
3.) Enable proxy, proxy_http and rewrite modules on apache:
sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod rewrite
4.) Create your custom apache proxy configuration file inside /etc/apache2/conf.d
NameVirtualHost *:80 <VirtualHost *:80> ProxyPreserveHost on RewriteEngine on ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ Redirect / http://localhost:8080/ RewriteRule ^/(.*) http://localhost:8080/$1 [P,L] </VirtualHost>
2 comments
Thanks a lot for this tutorial. However what i need to do is to forward apache's 80 to Glassfish's 8181.
I have a certificate already installed on glassfish, and a java E app that has in web.xml : CONFIDENTIAL. So how to forward to https without seing the port 8181 in the url?
thanks a lot
Very good tutorial
Thank you!
Post a Comment