LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Name based virtual Host for Apache and Tomcat (https://www.linuxquestions.org/questions/linux-server-73/name-based-virtual-host-for-apache-and-tomcat-821406/)

dinakumar12 07-22-2010 12:38 AM

Name based virtual Host for Apache and Tomcat
 
Hi Everyone,

I am having two domains. for ex: www.example1.com and www.example2.com. These two domains need to be hosted under one ip.

Yes by configuring name based virtual host we can do that.

But, my question is my first domain(www.example1.com) need to be hosted by Apache web server, and my second domain(www.example2.com) need to be hosted by Tomact.

Is it possible to configure name based virtual host for a scenario like this.

whether it is possible or not. Any suggestions would be helpful.

Thanks in advance,
Dinesh.

bathory 07-22-2010 03:10 AM

Hi,

Sure it can. There are two ways for doing so:
You can setup the 2nd vhost in apache to use mod_jk to communicate with tomcat to serve jsp pages,
Or you can setup the 2nd apache vhost as a reverse proxy for tomcat.

Regards

dinakumar12 07-22-2010 05:09 AM

Hi,

Thanks for your reply.How to use mod_jk, can you please elaborate on that.I have very little knowledge in this.

bathory 07-22-2010 08:16 AM

Hi,

Take a look at this howto to see what you have to do to use mod_jk. In your case put the mod_jk JkMount directives inside the vhost2 definition stanza

Regards

anomie 07-22-2010 12:12 PM

Quote:

Originally Posted by bathory
Or you can setup the 2nd apache vhost as a reverse proxy for tomcat.

I've found this approach (if you are running Apache 2.2) to be substantially easier. Using mod_proxy_ajp is a snap.

dinakumar12 07-23-2010 09:05 AM

Hi bathory,

Once again thank you for your help. we changed our plan of hosting apache and tomcat in same server. But i followed you link to install mod_jk apache tomcat connector and it worked fine.

Thanks&regards,
Dinesh.

anishkumarv 06-07-2011 09:12 AM

Hi dude,

Ya we are using MOD_JK only...


All times are GMT -5. The time now is 04:36 AM.