LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-22-2010, 12:38 AM   #1
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Blog Entries: 7

Rep: Reputation: 18
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.
 
Old 07-22-2010, 03:10 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
1 members found this post helpful.
Old 07-22-2010, 05:09 AM   #3
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi,

Thanks for your reply.How to use mod_jk, can you please elaborate on that.I have very little knowledge in this.
 
Old 07-22-2010, 08:16 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
Old 07-22-2010, 12:12 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
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.
 
Old 07-23-2010, 09:05 AM   #6
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
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.
 
Old 06-07-2011, 09:12 AM   #7
anishkumarv
Member
 
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 294

Rep: Reputation: 10
Hi dude,

Ya we are using MOD_JK only...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set apache virtual hosts Host-Based Security? hocheetiong Linux - Newbie 2 01-17-2014 04:20 AM
Aliasing for Virtual Host in Tomcat ??? your_shadow03 Linux - Server 1 11-24-2009 09:16 PM
Name and IP based virtual host in Apache hifun Linux - Newbie 5 06-17-2009 01:06 PM
Adding virtual interface for IP based virtual host pridefc Linux - General 6 03-16-2008 03:52 PM
Apache Virtual Host Problems with Tomcat 6 on Fedora 6 madhavr Linux - Server 2 05-08-2007 05:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration