This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Please excuse me if this question is in the wrong place but I think it's a Linux question more than anything else so I think belongs here.
I am going to be installing Tomcat on a Linux server (Redhat Enterprise Linux 3ES) and I am just wondering if anyone has a link to a good step by step guide on doing this.
I ask because while I am not totally clueless on Linux I do find that everything that should take 10 minutes takes me 3 days because of some gotcha that isn't well documented and it's all very frustrating.
I have looked at http://tomcat.apache.org/tomcat-5.5-doc/setup.html but it is less then comprehensive in my opinion. It looks like it should be so simple yet when I see make I panic because I know that means I will spend a day trying to figure out why it can't find all the bits it thinks it should be able to find.
So before I get myself all into a mental vapor lock state I was hoping someone knows of a good resource to again maybe offer a step by step guide on getting Tomcat installed correctly and safely on Linux.
Maximilian Xavier Stocker
Joined: Sep 20, 2005
Christmas Crackers! There's a Tomcat forum. Sorry. Maybe this question is better there... I don't know.
Originally posted by Maximilian Xavier Stocker: Christmas Crackers! There's a Tomcat forum. Sorry. Maybe this question is better there... I don't know.
No, you did right. This is more an OS question than a purely Tomcat one.
The easiest way to install tomcat is to pick a directory and unzip/untar it. /opt and /usr/local are favorites, though for a test tomcat, your home directory is OK.
There are other ways, though. There should be a Tomcat RPM for Red Hat. The downside, however is that it may not be that up-to-date and (worse yet) it may coerce you into that horrible "alternatives" system.
An IDE is no substitute for an Intelligent Developer.
Unzipping it is definitely most of the battle, but there's more. Do you want it to run as a dedicated "tomcat" user, and be launched by startup scripts when the machine boots? This isn't too hard, but the details vary by distribution. This is the kind of thing you get for free with a standard package for your particular flavor of Linux.
There is also the reserved port issue. On UNIX, the standard Web port 80 is "reserved" and only processes running as root can bind to it. For a C program, it's easy enough to start as root and then "demote yourself" to a less priveleged user. In Java, that can't be done, so you have to figure something out. On my machines, I use "iptables" to forward packets from an unprivileged port to port 80. Note that it's considered dangerous to run a public server process as root.
Then there's the really nasty issue of using Tomcat and Apache together. There is simply no easy way to do this, and no one who has done it successfully ever reports a better way. Lots of configuration on both ends, and compiling and assembling the appropriate bits and pieces. Bleah. Unless your site is huge, it's often best to just run the whole thing on Tomcat.
Originally posted by Ernest Friedman-Hill: Then there's the really nasty issue of using Tomcat and Apache together. There is simply no easy way to do this, and no one who has done it successfully ever reports a better way. Lots of configuration on both ends, and compiling and assembling the appropriate bits and pieces. Bleah. Unless your site is huge, it's often best to just run the whole thing on Tomcat.
The user stuff was bit of a concern as well but I think I can handle it... this part though was of MAJOR interest to me.
I blame myself (as I should) for not giving more details before but I am enourmously grateful for your mentioning this because this exactly what I was going to be attempting.
I have an existing Apache installation with numerous virtual sites and all the configuration for these sites. Over 2/3rds of these sites make heavy use of PHP.
I (obviously) erroneously assumed that I could configure Apache as follows.
So I guess I was wrong? There must be someway to do something as you don't say it's impossible.
I think my next step will be to repeatedly try things out on my development box although I find that's only so-so helpful because with out being valid for DNS reasons I can't test the vitual sites. Anyway we'll see.
Do you know of any articles/guides that discuss this type of setup? Am I totally lost? Can Tomcat be set up to process PHP as well? If I only had to move my virtual site configs over I could do that... [ April 13, 2006: Message edited by: Maximilian Xavier Stocker ]
Maximilian Xavier Stocker
Joined: Sep 20, 2005
I feel like the man cleaning his rifle and with eye peering down the barrel hears a voice behind saying "Did you know the safety is off?"
author and iconoclast
Do you know of any articles/guides that discuss this type of setup? Am I totally lost? Can Tomcat be set up to process PHP as well? If I only had to move my virtual site configs over I could do that...
Max, where are you at? Just a quick checklist:
Do you have java 5 installed? If so where? Do you have Tomcat 5.5 installed? If so where? I take it you haven't installed mod_jk yet is that so?
And no Tomcat doesn't do php (theoretically I believe it can) But why would you request something to apache that requests something to tomcat that requests something to php when apache can do it straight away?