This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
This company has always run RHEL, but we don't need their subscription service anymore so we are switching to CentOS. I've got the first CentOS server running and Tomcat is working, but I'm very puzzled.
Both servers are running Tomcat 6.0.2x but the configurations are vastly different. On the CentOS box there is no catalina.sh file or startup.sh, and there are no Tomcat environment variables such as CATALINA_HOME or CATALINA_BASE like there is on the RHEL servers. I can't figure out how it even runs, but "service tomcat start" works just fine.
I'm tempted to remove it, download the full package and install it manually, but it seems like I'd be better off to use yum because of the ease of upgrading, and the dependency resolution that it provides. But if I do that I'm left with an installation that I don't know how it works and that is unacceptable to me. I'm a nerd who has to take everything apart to see how it works. If it breaks, I can't fix it if I don't understand how it worked in the first place.
I can't find any documentation that explains how and why it's configured this way. Does anyone know of any such documentation or can you explain it to me? I find the lack of environment variables especially puzzling.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
There are basically 2 ways to install Tomcat on a RedHat-style OS. One is to use the actual files from tomcat.apache.org and the other is to use RPMs. Since you're referencing the "service startup" command, I'll hazard a guess that you're using the RPMs. I don't use them, BTW, even though I do almost everything else via RPM, including webapp installs. I'm afraid that the web of vendor-supplied RPMs required for Java is a little too complicated to make me happy, considering some old experiences.
The RPM-installed version of Tomcat relocates the installed Tomcat components from their usual centralized locations to the locations recommended by the LSB. Extending that, RedHat-style systems usually parameterize their service scripts with files locate under the /etc/sysconfig directory tree, so that user modification of the init scripts themselves is avoided.
You can search the RPM database to see the names of the packages of interest (assuming you don't already know) using command like this:
You can also get the manifest of files installed:
Assuming that the package is name "tomcat6".
As I said, I don't usually RPM-install Tomcat. Tomcat is almost 100% self-contained, so I just unzip a stock copy. In the cases where I need to customize Tomcat, I just copy the appropriate libraries into the Tomcat lib directory. The only real advantage to the RPM version is that it comes with its own init-script, but I have one I like anyway.
Customer surveys are for companies who didn't pay proper attention to begin with.
Thanks for the info. I've pretty much come to the conclusion that I need to remove it and install manually. That way the directory structure will mirror our RHEL servers, and I can re-use our existing scripts with some slight modifications. The RPM installs are convenient, but I dislike the lack of control. As much as it pains me to say it, at least Windoze apps usually allow me to choose the name and location of the destination folder. RPM installs are "take it or leave it".
In this case, I think I'll choose "leave it".
And don't even get me started on these links that point to other links. I don't like having to follow a trail of breadcrumbs to figure out what the real file is and where it resides.