[Slackbuilds-users] Some issues with Apache Tomcat
Antonio Hernández Blas
hba.nihilismus at gmail.com
Tue Jan 20 00:50:10 UTC 2015
Hi, i'm trying to understand how it is integrated Apache Tomcat into
Slackware using the available SlackBuild at SBo.
First some facts:
* $CATALINA_HOME and $CATALINA_BASE are **global** environment variables.
* $CATALINA_HOME is set to /usr/share/tomcat
* $CATALINA_BASE is set to /var/lib/tomcat
* Inside $CATALINA_HOME:
* Inside $CATALINA_BASE:
* bin -> /usr/share/tomcat/bin/
* conf -> /etc/tomcat/
* logs -> /var/log/tomcat/
* temp -> /var/tmp/tomcat/
* work -> /var/run/tomcat/
* /etc/rc.d/rc.tomcat has hardcoded values for $PIDFILE, $LOGFILE and
$USER, and expects the environment variable $CATALINA_BASE has been already
defined (which it is since it is a **global** environment variable).
Now the questions/issues:
* Trying to integrate $CATALINA_BASE into Eclipse does not work, i get the
"Unknown version of Tomcat was specified."
And from Netbeans i get:
"The specified Server Location (Catalina Home) folder is not valid."
This is because there is not a lib directory inside $CATALINA_BASE so to
fix it one must execute (as root):
# ln -s $CATALINA_HOME/lib $CATALINA_BASE/
Trying to integrate $CATALINA_HOME neither, i get the error message from
"Could not load the Tomcat server configuration at /Servers/Tomcat v7.0
Server at localhost-config. The configuration may be corrupt or incomplete."
And from Netbeans:
"The <CATALINA_HOME>/conf/server.xml can't be read."
To fix it one must execute (as root):
# ln -s /etc/tomcat/ $CATALINA_HOME/conf
* Once i try to execute Apache Tomcat with Netbeans i get the error:
"Starting of Tomcat failed, check whether the
/usr/share/tomcat/bin/catalina.sh and related scripts are executable"
To fix it execute (as root):
# chmod +x $CATALINA_HOME/bin/*.sh
So finally some questions:
* Why the distinction between $CATALINA_HOME and $CATALINA_BASE?. As i
understand this is just when you want to have multiple instances of Apache
Tomcat, each one sharing some directories from $CATALINA_HOME while keeping
their own configuration/libraries     separated. Actually, this
is what Eclipse/Netbean does, it ask you for $CATALINA_HOME and create a
$CATALINA_BASE directory to manage it execution ("Create a local server").
IMHO there should not be $CATALINA_BASE **globally**, but **locally**
But remember that /etc/rc.d/rc.tomcat has hardcoded values for $PIDFILE,
$LOGFILE and $USER to work with $CATALINA_BASE so i am not sure this is the
case for multiple instances. Anyway these environment variable would be
uniques to each instance of tomcat (if this is the case) so a better place
to define them would be $CATALINA_BASE/conf/tomcat-java.conf, which brings
the next question.
* Why the configuration files are keep in /etc/tomcat?. Is this some kind
of "HIER or die!"? ;-)
* And finally, why the $CATALINA_HOME/bin/*.sh files are keep with 0744 as
permission? It is for some kind of security?.
I hope to make clear my questions and not generate more ;-)
Antonio Hernández Blas | Oaxaca, México, Mx.
https://github.com/nihilismus | https://bitbucket.org/nihilismus |
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SlackBuilds-users