Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

differences in Tomcat install on different distros

 
J. Kevin Robbins
Bartender
Pie
Posts: 1793
20
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
J. Kevin Robbins
Bartender
Pie
Posts: 1793
20
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic