Reputation: 12038
Hello I am looking to install Apache-Tomcat on a RedHat linux and I am interested if there is a standard place for this to be installed. in other work I have seen tomcat installed at
/opt/apache-tomcat-[VERSION]/
but I would expect it to be found under /usr. Best answer will have a link to authoritative site.
Thanks so much,
David.
Upvotes: 12
Views: 23424
Reputation: 1932
Someone else mentioned http://www.pathname.com/fhs/pub/fhs-2.3.html, which is good information. Unfortunately, they didn't provide any accompanying information with it, aside from a snarky comment.
According to that document, /opt is where installed software would go, so I would recommend /opt/tomcat, and set CATALINA_HOME to this directory.
It also says /var is where variable data would go, so I would put it in /var/tomcat and set CATALINA_BASE to this directory.
I'll add a little background. If you don't set CATALINA_BASE, then it will default to the same as CATALINA_HOME. However, CATALINA_HOME should be the unadulterated install, and should be set as read-only. You should use a different location for variable stuff like your actual web directories and logs. Then, when you need to change versions, it's just as simple as changing CATALINA_HOME. Also, you can run multiple instances of Tomcat more easily without having multiple copies of the same install.
Also, don't forget to create a CATALINA_BASE/bin/setenv.sh (or .bat for Windows) file instead of editing CATALINA_HOME/bin/catalina.sh (or .bat for Windows).
Yeah, this is more information than anyone asked for, but hopefully someone will find it useful.
Upvotes: 3
Reputation: 928
Well there is an easy answer for that here, too bad nobody of these high-pointers have listed it:
http://www.pathname.com/fhs/pub/fhs-2.3.html
Upvotes: 1
Reputation: 21160
There's a Red Hat RPM package for Tomcat 6 - just "yum install tomcat6" and it will put everything in the right place for you and fix up the security by running Tomcat as a dedicated user (not to mention taking care of updates and patches by putting Tomcat into the RPM repository).
Most of the executables, the configuration and the webapp directory end up under /var/lib/tomcat6 using this method.
Upvotes: 3
Reputation: 207
I'm fairly certain it doesn't matter.
Just like most well-behaved Java apps look for the JAVA_HOME environment variable to locate the preferred Java installation, once you've set CATALINA_HOME in either .bashrc or .profile of the affected users, software needing to locate Tomcat should be able to find it.
Upvotes: 0
Reputation: 871
It depends on who you ask, but I see it this way:
/opt is typically for third-party add-on software. /usr/ is often for 'system' software. User compiled apps go in /usr/local.
I put tomcat in /opt/apache-tomcat-VERSION. I then make a symlink to it as /opt/tomcat.
The Linux Standards Base may have more info on the matter.
Upvotes: 9
Reputation: 57333
I don't know if there's such a thing as an "official" place, but a reasonable thing to do would be to do what you've done and refer to tomcat through a softlink at /usr/local/tomcat or some such, which would allow you to upgrade versions by simply installing a new version in opt and changing the softlink.
Upvotes: 11