JBoss Application Server 7 on Port 80 with Apache HTTPd ProxyPass
The 9 steps to proxy success!
- Install Apache2.
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod vhost_alias
sudo a2dissite default(only if you are not using this site, or haven’t made changes to it)
- Create a file called jboss-as in /etc/apache2/sites-available:
<VirtualHost *:80> ServerAdmin email@example.com ServerName site.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost on ProxyPass / http://localhost:8080/ </VirtualHost>
sudo a2ensite jboss-as
- Make sure your JBoss AS 7 instance is running on port 8080, and is accepting connections from localhost.
sudo /etc/init.d/apache2 restart-or-
service apache2 restart
In summaryThat’s it! Your JBoss AS 7 instance should now be available on Port 80. You can, of course, make further customizations to this configuration; it is merely a bare minimal example in order to get up and running. As always, I hope this has been helpful. Please let me know how it works for you!
About the author:
Lincoln Baxter, III is the Chief Editor of Red Hat Developers, and has worked extensively on JBoss open-source projects; most notably as creator & project lead of JBoss Forge, author of Errai UI, and Project Lead of JBoss Windup. This content represents his personal opinions, not those of his employer.
He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing competitive Magic: The Gathering, Lincoln is focused on promoting open-source software and making technology more accessible for everyone.