Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th February 2009, 01:32 PM
tictac Offline
Registered User
 
Join Date: Feb 2009
Posts: 31
Apache with Java Support (tomcat)

Greetings everyone.

I've got a question: how should I make the Apache vhosts to support the jsp extension?

PS:I've installed and loaded the mod_jk.
Reply With Quote
  #2  
Old 27th February 2009, 02:18 PM
tictac Offline
Registered User
 
Join Date: Feb 2009
Posts: 31
Anyone with a idea?
Reply With Quote
  #3  
Old 27th February 2009, 02:39 PM
fwelland Offline
Registered User
 
Join Date: Mar 2005
Location: US
Posts: 110
I can't directly answer your question -- but give you some hints.

One thing you consider doing is just run tomcat as a web server -- and not run apache at all. This of course depends on your needs, as maybe there is something in apache that tomcat won't provide. Tomcat will provide all web-container stuff plus basic file serving.

If you need apache -- by it self -- I don't think it has any thing to actually process JSPs and servlets (insider of it). Rather, typically, you configure apache to forward http requests to a web container like tomcat. You are in the right area with the mod_jk apache plugin -- there is also the mod_proxy stuff in Apache 2.x

Basically with these apache plugins you select certain URL patterns to be forwarded to, for example, tomcat. On the tomcat side, you configure the appropriate connector to accept http requests forwarded to tomcat from apache.

there is a quick how-to here: http://tomcat.apache.org/connectors-...wto/quick.html
Reply With Quote
  #4  
Old 1st March 2009, 01:26 PM
tictac Offline
Registered User
 
Join Date: Feb 2009
Posts: 31
Well, I would run Tomcat, but I don't know to handle vhosts!

In apache was simple, 2 files for editing, the httpd.conf and the vhost itself. I've watched many tutorials on how to vhost the Tomcat, but didn't get it for Linux!
Reply With Quote
  #5  
Old 1st March 2009, 01:42 PM
sentry Offline
Registered User
 
Join Date: Jul 2005
Posts: 591
You shouldn't need to mess around with many files to deploy a webapp in Tomcat. Just pack your app as a war file and drop it into /usr/share/tomcat/webapps/ and it will unpack and deploy itself.
Reply With Quote
  #6  
Old 1st March 2009, 01:48 PM
Sauron Offline
Registered User
 
Join Date: Jan 2005
Posts: 257
I've not done it myself, but I didn't think mod_jk worked in Apache 2.2, you needed to use mod_proxy_ajp or something?

Quick google came up with http://rimuhosting.com/mod_jk2_and_mod_proxy_ajp.jsp - maybe that's a place to start?
Reply With Quote
  #7  
Old 1st March 2009, 03:50 PM
fwelland Offline
Registered User
 
Join Date: Mar 2005
Location: US
Posts: 110
Quote:
Originally Posted by tictac View Post
Well, I would run Tomcat, but I don't know to handle vhosts!

In apache was simple, 2 files for editing, the httpd.conf and the vhost itself. I've watched many tutorials on how to vhost the Tomcat, but didn't get it for Linux!

There are (at least) 2 ways to do this with tomcat alone.

One way, -- tomcat has virtual host -- you can look here: http://tomcat.apache.org/tomcat-5.5-...ing-howto.html (or the same pages but for 6.0x etc)...

Have multiple IPs for a host (either multi-nics or single nic) and start different tomcat instances binding to different ports...and configure tomcat instances as per virtual hosts needs.
Reply With Quote
  #8  
Old 1st March 2009, 04:46 PM
tictac Offline
Registered User
 
Join Date: Feb 2009
Posts: 31
Well, the binding of different ports it's not useful, because the websites must be avalable at www.examplesite.com, not www.examplesite.com: port

About the tomcat vhost, if you have a server configured that way, can you please post some conf. examples?

Thank you in advance!

PS: I've installed mod_jk and it's successfully loaded in Apache, but if I make a Apache vhost and point the vhost to the location of the java index file, it's not loading

Last edited by tictac; 1st March 2009 at 04:49 PM.
Reply With Quote
  #9  
Old 1st March 2009, 06:00 PM
fwelland Offline
Registered User
 
Join Date: Mar 2005
Location: US
Posts: 110
Quote:
Originally Posted by tictac View Post
Well, the binding of different ports it's not useful, because the websites must be avalable at www.examplesite.com, not www.examplesite.com: port

About the tomcat vhost, if you have a server configured that way, can you please post some conf. examples?

Thank you in advance!

PS: I've installed mod_jk and it's successfully loaded in Apache, but if I make a Apache vhost and point the vhost to the location of the java index file, it's not loading
Actually -- you'd bind to the same port (e.g. 80) but on different IPs....For example, I've built a web app that had a few parts that we ran on 2 tomcats and a jboss. We had 3 public urls -- for example -- www.mysite.com , admin.mysite.com, and reports.mysite.com

I my case, we had 2 IPs on one box and I ran 2 tomcats, report.mysite.com on port 80 and admin.mysite.com on port 80 but on a different IP number (one IP for report.mysite.com and one IP for admin.mysite.com)... There is no real magic with this -- just have multiple IPs on one piece of hardware. You don't have to have multiple nics -- but often web apps might have multi-nics. you can do this type of thing on both windows and unix/linux.

As for Tcat and its vhost stuff. Sorry I just know that there is some sort of ability to do it...I've never really used that feature. I have done the multi-ip thing....

And I haven't really used mod-jk in apache either -- just know about it... My current work does use a reverse proxy widget (I think mod-proxy) in apache to front-end our JBOSS instances (i.e. tomcat) -- but that just acts as a traffic cop forwarding URLs to different JBOSSes based on a pattern....(not using AJP connector)... We dont' really have any vhosts...and I am not up to speed on the apache setup..


hth....
Reply With Quote
Reply

Tags
apache, java, support, tomcat

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java and Tomcat??? kittykattycat Installation and Live Media 2 11th June 2008 03:20 PM
Tomcat and apache nayeemmz Using Fedora 2 23rd June 2006 04:37 PM
FC2 + Apache 2 + Tomcat 5 LeAkEd Guides & Solutions (No Questions) 2 27th June 2005 09:55 AM
Apache and Tomcat RaCarter Servers & Networking 2 20th September 2004 09:13 AM


Current GMT-time: 10:31 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat