JBoss Application Server 7 on Port 80 with Apache HTTPd ProxyPass

Posted by: Lincoln Baxter III on 01/09/2012

It’s quite simple really. All you need to do is install Apache HTTPd, then set make sure you have a few modules installed and set up:

Instructions below are for Ubuntu, Fedora, RHEL, or other Linux distributions. The results of this configuration can be seen at scrumshark.com, our latest open-source project management software initiative. We’re looking for contributors! (that means you.) So please come get involved! We are looking for help with the front-end graphical design and widgets like charts, graphs, and visualizations (or anything you are interested in.)

So what are you waiting for? Let’s get our JBoss / Apache love on.

The 9 steps to proxy success!

  1. Install Apache2.
  2. sudo a2enmod proxy
  3. sudo a2enmod proxy_http
  4. sudo a2enmod vhost_alias
  5. sudo a2dissite default (only if you are not using this site, or haven’t made changes to it)
  6. Create a file called jboss-as in /etc/apache2/sites-available:

    <VirtualHost *:80>
            ServerAdmin admin@site.com
            ServerName site.com
            ProxyRequests Off
            <Proxy *>
                    Order deny,allow
                    Allow from all
            </Proxy>
            ProxyPreserveHost on
            ProxyPass / http://localhost:8080/
    </VirtualHost>
  7. sudo a2ensite jboss-as
  8. Make sure your JBoss AS 7 instance is running on port 8080, and is accepting connections from localhost.
  9. sudo /etc/init.d/apache2 restart -or- service apache2 restart

In summary

That’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 Lincoln Baxter III

Lincoln Baxter III

Creator of PrettyFaces - Url Rewriting for JSF, PrettyTime - Social-style date & time formatting for Java, and a community contributor to the JSF2 Expert Group; his latest project is ScrumShark, an open-source agile project management tool.

Beginning his career in C, C++ development for hardware signal testing automation, Lincoln soon moved on to Perl, dynamic programming languages, artificial intelligence and, more recently - web application frameworks such as Java Server Faces and Groovy on Grails for financial and small business solutions.

When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on improving the openness of Java, the Java Community Process(JCP), and bringing the J2EE platform to small businesses and freelancers.

More About Lincoln »

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 7
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 3
  • Automation Tools: Git, Hudson, Sonar
  • HTML5, Ajax, jQuery, Usability
  • Mobile Applications - iPhone and Android
  • More...
Learn More »

NFJS, the Magazine

May Issue Now Available
  • Client-Side MVC with Spine.js, Part 1

    by Craig Walls
  • On Prototypal Inheritance, Part 2

    by Raju Gandhi
  • Making use of Scala Lazy Collections

    by Venkat Subramaniam
  • Integration Testing Web Applications Using Gradle

    by Kenneth Kousen
Learn More »