<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div>Hi, i'm trying to understand how it is integrated Apache Tomcat into Slackware using the available SlackBuild at SBo.<br><br></div>First some facts:<br><br></div><div>*  $CATALINA_HOME and $CATALINA_BASE are **global** environment variables.<br></div>*  $CATALINA_HOME is set to /usr/share/tomcat<br></div>*  $CATALINA_BASE is set to /var/lib/tomcat<br></div>*  Inside $CATALINA_HOME:<br></div>   *  bin/<br></div>   *  lib/<br></div>*  Inside $CATALINA_BASE:<br>   *  bin -> /usr/share/tomcat/bin/<br>   *  conf -> /etc/tomcat/<br>   *  logs -> /var/log/tomcat/<br>   *  temp -> /var/tmp/tomcat/<br>   *  webapps/<br>   *  work -> /var/run/tomcat/<br></div>*  /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).<br><br></div>Now the questions/issues:<br><br></div>*  Trying to integrate $CATALINA_BASE into Eclipse does not work, i get the message:<br><br>   "Unknown version of Tomcat was specified."<br><br></div><div>   And from Netbeans i get:<br><br>   "The specified Server Location (Catalina Home) folder is not valid."<br><br></div><div>   This is because there is not a lib directory inside $CATALINA_BASE so to fix it one must execute (as root):<br><br>   # ln -s $CATALINA_HOME/lib $CATALINA_BASE/<br><br>   Trying to integrate $CATALINA_HOME neither, i get the error message from Eclipse:<br><br>   "Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete."<br></div><div><br></div><div>   And from Netbeans:<br><br>   "The <CATALINA_HOME>/conf/server.xml can't be read."<br><br></div><div>   To fix it one must execute (as root):<br><br>   # ln -s /etc/tomcat/ $CATALINA_HOME/conf<br></div><div><div><br clear="all"><div><div><div><div><div><div><div><div><div><div><div>*  Once i try to execute Apache Tomcat with Netbeans i get the error:<br><br></div><div>   "Starting of Tomcat failed, check whether the /usr/share/tomcat/bin/catalina.sh and related scripts are executable"<br><br></div><div>   To fix it execute (as root):<br><br></div><div>   # chmod +x $CATALINA_HOME/bin/*.sh<br><br></div><div>So finally some questions:<br><br></div><div>*  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 [1] [2] [3] [4] 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").<br></div><div><br>   IMHO there should not be $CATALINA_BASE **globally**, but **locally** (/etc/rc.d/rc.tomcat maybe).<br><br></div><div>   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.<br><br></div><div>*  Why the configuration files are keep in /etc/tomcat?. Is this some kind of "HIER or die!"? ;-)<br><br></div><div>*  And finally, why the $CATALINA_HOME/bin/*.sh files are keep with 0744 as permission? It is for some kind of security?.<br><br></div><div>I hope to make clear my questions and not generate more ;-)<br></div><div><br></div><div>- Cheers<br></div><div><br>[1] <a href="http://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt">http://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt</a><br>[2] <a href="http://java.dzone.com/articles/running-multiple-tomcat">http://java.dzone.com/articles/running-multiple-tomcat</a><br>[3] <a href="http://www.ramkitech.com/2011/07/running-multiple-tomcat-instances-on.html">http://www.ramkitech.com/2011/07/running-multiple-tomcat-instances-on.html</a><br>[4] <a href="http://blogs.vmware.com/vfabric/2012/10/5-scenarios-and-best-practices-for-running-multiple-instances-of-tomcat-or-tc-server.html">http://blogs.vmware.com/vfabric/2012/10/5-scenarios-and-best-practices-for-running-multiple-instances-of-tomcat-or-tc-server.html</a><br></div><div><br></div><div>-- <br><div class="gmail_signature"><div dir="ltr">Antonio Hernández Blas | Oaxaca, México, Mx.<br><a href="https://github.com/nihilismus" target="_blank">https://github.com/nihilismus</a> | <a href="https://bitbucket.org/nihilismus" target="_blank">https://bitbucket.org/nihilismus</a> | <a href="https://twitter.com/nihilipster" target="_blank">https://twitter.com/nihilipster</a></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div>