I am building a solution where the CMS part of the site (i.e. About US, Contact etc) will be run on Wordpress & the private pages will be a Java-Servlet based stack run on Tomcat 7.
Both of these "apps" have to run on the same server for budget reasons, at least for now.
What I want to know how to make this happen (via configurations, setups etc)? So that whenever users come to public pages they will be served content from Wordpress but for private pages (here I am assuming there will be a URL pattern differentiating this) then it will be served by Tomcat
I am assuming here that I will be using Apache as the server for fronting the wordpress requests. Also it is an Ubuntu 12.04 server.
I think the technology you are looking for is a reverse proxy. Configure your tomcat to listen on 8080 and have apache act as a proxy for it using mod_proxy_ajp or similar.
I recently put all together with Quercus (a PHP5 java implementation) building up a single WAR file with the latest wordpress.
http://bonfab.io/jwordpress/
Taking @lain's direction I was able to finally resolve the issue by doing couple of things.
Here is virtual hosts file,