Kyle Brentnell wrote:

Hello,

I am trying to have Cocoon automatically start when my linux box starts up.

I am using:
Cocoon 2.1.3
Tomcat ???
Apache 2.0.40
Linux RedHat8

All I can find in the docs/FAQs/etc are instructions for starting Tomcat
using tomcat.sh or catalina.sh. There are no tomcat.sh or catalina.sh files
on my system.


...

I am guessing that Tomcat is more hidden in version 2.1.3 of Cocoon.



Pretty hidden indeed! Tomcat isn't now and never was included in Cocoon. A slimmed down version of Jetty was bundled sometime in 2.1 for convenience of trying Cocoon out, but for production you'd want the full version of Jetty or Tomcat, or something else.


Once Cocoon is installed in one of these containers, your question boils down to how to start the servlet container on startup, and that comes to placing or linking a start script in rc3.d as you would any other startup bit on linux. The biggest issue is how to do so and start as some user other than root. Someone may have a better suggestion but I personally use a script (below) that basically does su - webuser tomcat.sh

HTH,
Geoff

#!/bin/sh
#

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

TOMCAT_HOME=/opt/tomcat
TOMCAT_OWNER=webuser
export JAVA_HOME=/opt/java

if [ ! -f $TOMCAT_HOME/bin/startup.sh -o ! -d $TOMCAT_HOME ]; then
       echo "Tomcat startup: cannot start"
       exit
fi

# See how we were called.
case "$1" in
 start)
       echo -n "Starting Tomcat: "
       su - $TOMCAT_OWNER -c $TOMCAT_HOME/bin/startup.sh
       echo
       touch /var/lock/subsys/tomcat
       ;;
 stop)
       # Stop daemons.
       echo -n "Shutting down Tomcat: "
       su - $TOMCAT_OWNER -c $TOMCAT_HOME/bin/shutdown.sh
       echo
       rm -f /var/lock/subsys/tomcat
       ;;
 restart)
       $0 stop
       $0 start
       ;;
 status)
       ;;
 *)
       echo "Usage: tomcat {start|stop|restart|status}"
       exit 1
esac

exit 0


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to