[Slackbuilds-users] Some issues with Apache Tomcat
Miguel De Anda
miguel at thedeanda.com
Tue Jan 27 08:24:30 UTC 2015
I remember running into similar issues with jboss/wildfly about a year ago
where the maintainer moved folders around and created a neat little web of
symlinks. The problems is that while its generally good practice to put
configuration in /etc, pids in /var/run, logs in /var/log, etc. it can
sometimes be problematic for for software not written this way. Java
applications like jetty, tomcat, wildfly, jboss, solr, etc. are much easier
to maintain and run when they are just left as is.
I've resolved to not using slackbuilds for any java programs and install I
manually extract and run as my user account. (The only exception is
apache-ant, that works well)
It might be worth playing around with /etc/profile.d/ and adding a tomcat.*
set for those variables. It might help with eclipse
On Mon, Jan 19, 2015 at 4:50 PM, Antonio Hernández Blas <
hba.nihilismus at gmail.com> wrote:
> 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:
> * bin/
> * lib/
> * Inside $CATALINA_BASE:
> * bin -> /usr/share/tomcat/bin/
> * conf -> /etc/tomcat/
> * logs -> /var/log/tomcat/
> * temp -> /var/tmp/tomcat/
> * webapps/
> * 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 message:
> "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 Eclipse:
> "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**
> (/etc/rc.d/rc.tomcat maybe).
> 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 ;-)
> - Cheers
>  http://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt
>  http://java.dzone.com/articles/running-multiple-tomcat
> Antonio Hernández Blas | Oaxaca, México, Mx.
> https://github.com/nihilismus | https://bitbucket.org/nihilismus |
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - http://slackbuilds.org/faq/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SlackBuilds-users