0

I have a server system on which i want to host java web application's. I can do that only with tomcat and can host multiple application's, but i don't know how can i host multiple application's on root of tomcat, so that i can access those application's with their domain names like example.com,example2.com and so on. Something like virtual shared hosting.

I have used Ngasi and liked the features that allow me to host multiple apps. on root context. Unfortunately Ngasi is not free, so i am looking for a free alternative to Ngasi that can manage the virtual shared hosting.

2 Answers 2

0

Hosting several applications in one Tomcat is always problematic. You can't easily restart just one application without affecting all the others.

What works for me is an apache2 / httpd web server as the front end (can also handle many domain names, ssl, rewrite etc.) which then forwards everything to several Tomcat instances, either running on the same server or even on different servers. Just use different port numbers.

Here's an example entry:

<VirtualHost *:80>

  <Directory /home/web0000/www>
    Options FollowSymLinks
    Order allow,deny
    Allow from all
  </Directory>

  DocumentRoot /home/web0000/www

  ProxyPass        /robots.txt !
  ProxyPass        /path1       http://localhost:9002/path1       
  ProxyPassReverse /path1       http://localhost:9002/path1       
  ProxyPass        /anotherpath http://localhost:9012/anotherpath 
  ProxyPassReverse /anotherpath http://localhost:9012/anotherpath 
  ProxyPass        /path3       http://localhost:9022/path3       
  ProxyPassReverse /path3       http://localhost:9022/path3       

  ServerAdmin [email protected]
  ServerName example.mydomain.tld

</VirtualHost>
0

It is easy to host multiple domains/apps at Jelastic. Here is detailed instructions http://jelastic.com/docs/multiple-domains and http://jelastic.com/docs/multiple-domains2.

1
  • Please don't just answer with a link, give some summary so in a year's time (when the link if gone for good) the answer still has some use.
    – vonbrand
    Apr 3, 2013 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .