This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
heartbeat:tomcat6 [2012/01/02 15:37] – [Tomcat6 Initscript] tmade | heartbeat:tomcat6 [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | [[http:// | ||
- | [[http:// | ||
- | |||
- | [[http:// | ||
- | |||
- | ===== Tomcat Log ===== | ||
- | |||
- | " | ||
- | |||
- | ===== Tomcat6 Linux-HA ===== | ||
- | |||
- | ==== Tomcat6 Initscript ==== | ||
- | | ||
- | The following script (/ | ||
- | |||
- | < | ||
- | #! /bin/sh | ||
- | # | ||
- | # Author: Thomas Roehm | ||
- | # | ||
- | # / | ||
- | # | ||
- | # and symbolic its link | ||
- | # | ||
- | # / | ||
- | # | ||
- | ### BEGIN INIT INFO | ||
- | # Provides: tomcat6 | ||
- | # Required-Start: | ||
- | # Required-Stop: | ||
- | # Default-Start: | ||
- | # Default-Stop: | ||
- | # Description: | ||
- | # Startup script for Tomcat | ||
- | # description: | ||
- | ### END INIT INFO | ||
- | #Necessary environment variables | ||
- | export CATALINA_HOME="/ | ||
- | |||
- | if [ ! -f $CATALINA_HOME/ | ||
- | then | ||
- | echo " | ||
- | exit | ||
- | fi | ||
- | |||
- | start() { | ||
- | echo -n -e ' | ||
- | su -l tomcat -c $CATALINA_HOME/ | ||
- | sleep 3 | ||
- | } | ||
- | |||
- | stop() { | ||
- | PID=`(cat / | ||
- | echo -n -e ' | ||
- | su -l tomcat -c $CATALINA_HOME/ | ||
- | sleep 10 | ||
- | kill $PID | ||
- | rm / | ||
- | } | ||
- | |||
- | status() { | ||
- | ps ax --width=2000 | grep " | ||
- | read line < / | ||
- | if [ $line == 2 ]; then | ||
- | echo -n " | ||
- | ps ax --width=2000 | grep " | ||
- | echo -n ") is running..." | ||
- | echo | ||
- | else | ||
- | echo " | ||
- | fi | ||
- | } | ||
- | |||
- | status() { | ||
- | ps ax | grep " | ||
- | read line < / | ||
- | if [ $line -gt 0 ]; then | ||
- | echo -n " | ||
- | ps ax --width=2000 | grep " | ||
- | echo -n ") is running..." | ||
- | echo | ||
- | else | ||
- | echo " | ||
- | fi | ||
- | } | ||
- | |||
- | case " | ||
- | start) | ||
- | start | ||
- | ;; | ||
- | stop) | ||
- | stop | ||
- | ;; | ||
- | restart) | ||
- | stop | ||
- | sleep 15 | ||
- | start | ||
- | ;; | ||
- | status) | ||
- | status | ||
- | ;; | ||
- | *) | ||
- | echo " | ||
- | exit 1 | ||
- | esac | ||
- | </ | ||
- | |||
- | Additionally to start/stop with " | ||
- | |||
- | ln –s / | ||
- | |||
- | ==== Heartbeat Initscript for Tomcat6 ==== | ||
- | |||
- | The file „/ | ||
- | |||
- | < | ||
- | #!/bin/sh | ||
- | export OCF_ROOT=/ | ||
- | CATALINA_HOME=" | ||
- | export CATALINA_HOME | ||
- | . ${OCF_ROOT}/ | ||
- | INIT_SCRIPT=/ | ||
- | |||
- | case " | ||
- | start) | ||
- | cd " | ||
- | ${INIT_SCRIPT} start > /dev/null 2>&1 && exit || exit 1 | ||
- | ;; | ||
- | stop) | ||
- | cd " | ||
- | ${INIT_SCRIPT} stop > /dev/null 2>&1 && exit || exit 1 | ||
- | ;; | ||
- | status) | ||
- | cd " | ||
- | ${INIT_SCRIPT} status > /dev/null 2>&1 && exit || exit 1 | ||
- | ;; | ||
- | |||
- | monitor) | ||
- | cd " | ||
- | # Check if Ressource is stopped | ||
- | ${INIT_SCRIPT} status > /dev/null 2>&1 || exit 7 | ||
- | |||
- | # Otherwise check services (XXX: Maybe loosen retry / timeout) | ||
- | wget --no-proxy -O /dev/null http:// | ||
- | ;; | ||
- | |||
- | meta-data) | ||
- | cat <<END | ||
- | <?xml version=" | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | OCF Ressource Agent for Tomcat6. | ||
- | </ | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | Home directory of Tomcat | ||
- | </ | ||
- | < | ||
- | <content type=" | ||
- | </ | ||
- | </ | ||
- | < | ||
- | <action name=" | ||
- | <action name=" | ||
- | <action name=" | ||
- | <action name=" | ||
- | <action name=" | ||
- | <action name=" | ||
- | </ | ||
- | </ | ||
- | END | ||
- | ;; | ||
- | esac | ||
- | </ | ||
- | |||
- | ==== Catalina(.sh) Variables / Parameters ==== | ||
- | |||
- | CATALINA_PID=/ | ||
- | --DisplayName ServiceName # | ||
- | |||
- | Examples of paramters set in {$Tomcat}/ | ||
- | |||
- | < | ||
- | CATALINA_OPTS=" | ||
- | -Djava.awt.headless=true \ | ||
- | -Dcatalina.home=$CATALINA_BASE \ | ||
- | -Dcatalina.base=$CATALINA_BASE \ | ||
- | -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \ | ||
- | -Djava.util.logging.config.file=conf\logging.properties \ | ||
- | -Djavax.xml.validation.SchemaFactory: | ||
- | -Xmx5021M \ | ||
- | -XX: | ||
- | -XX: | ||
- | -XX: | ||
- | -Djava.compiler=NONE \ | ||
- | -Xdebug \ | ||
- | -Xrunjdwp: | ||
- | -Xnoagent \ | ||
- | -Dcom.sun.management.jmxremote=true \ | ||
- | -Dorg.eclipse.jdt.core.compiler.source=1.5 \ | ||
- | -Dorg.eclipse.jdt.core.compiler.compliance=1.5 \ | ||
- | -Djavax.xml.datatype.DatatypeFactory=com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl \ | ||
- | -DconfigurationsFilePath=/ | ||
- | -DoptionalConfigurationsFilePath=/ | ||
- | -Dcompression=false \ | ||
- | -Duser.language=de \ | ||
- | -Duser.country=DE \ | ||
- | -Dcontentgrabber.default.charset=iso-8859-1 \ | ||
- | -Dmail.mime.charset=UTF-8 \ | ||
- | -Djavax.xml.bind.JAXBContext=com.sun.xml.bind.v2.ContextFactory \ | ||
- | -Djavax.net.ssl.keyStore=/ | ||
- | -Djavax.net.ssl.keyStorePassword=ecrm \ | ||
- | -Dhttp.proxyHost=10.6.3.15 \ | ||
- | -Dhttp.proxyPort=8080 \ | ||
- | -Djava.io.tmpdir=/ | ||
- | -Dorg.eclipse.jdt.core.compiler.codegen.TargetPlatform=1.5 \ | ||
- | -DlogsFilePath=/ | ||
- | -Dhttp.nonProxyHosts=localhost|127.0.0.1 \ | ||
- | -Dhttps.nonProxyHosts=localhost|127.0.0.1 " | ||
- | # | ||
- | |||
- | </ | ||
- | |||
- | ==== Forwarding to webapplication ==== | ||
- | Edit / | ||
- | |||
- | < | ||
- | < | ||
- | |||
- | < | ||
- | <meta http-equiv=" | ||
- | </ | ||
- | |||
- | < | ||
- | </ | ||
- | |||
- | </ | ||
- | </ | ||
- | |||
- | ==== Certificat Request ==== | ||
- | |||
- | Tomcat: | ||
- | |||
- | Create a local Certificate: | ||
- | |||
- | keytool -genkey -alias tomcat –keysize 2048 -keyalg RSA -keystore < | ||
- | |||
- | The CSR is then created with: | ||
- | |||
- | keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr -keystore < | ||
- | |||
- | Import the Chain Certificate into you keystore: | ||
- | |||
- | keytool -import -alias root -keystore < | ||
- | |||
- | And finally import your new Certificate: | ||
- | |||
- | keytool -import -alias tomcat -keystore < | ||
- | |||
- | Official: | ||
- | |||
- | < | ||
- | Tomcat (keytool) | ||
- | |||
- | This document provides instructions for installing TC Trust SSL certificate. | ||
- | 1 Install the Root CA certificate | ||
- | You must first obtain the Root CA certificate (TC TrustCenter Class 2 CA II) and save the Root CA certificate as root.cer. In the following example please replace the example keystore name ' | ||
- | |||
- | Use the following command to import this certificate in the keystore: | ||
- | |||
- | keytool -import -alias root -keystore keystore.key -trustcacerts -file root.cer | ||
- | |||
- | 2 Install the Intermediate CA certificate | ||
- | |||
- | Create a file in Notepad and save the Intermediate CA certificate (TC TrustCenter Class 2 L1 CA XI) as intermediate.cer. | ||
- | |||
- | Use the following command to import this certificate in the keystore: | ||
- | |||
- | keytool -import -alias intermediate -keystore keystore.key -trustcacerts -file intermediate.cer | ||
- | |||
- | 3 Install the TC Trust SSL certificate | ||
- | |||
- | Your TC Trust SSL certificate will be sent via email. Look for the TC Trust SSL certificate text in the body of the email and copy and paste it into a .crt file (such as tc_server.crt) using Vi or Notepad. Please be sure to include the header and footer as well as the surrounding dashes including the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines. | ||
- | NOTE: Do not use Microsoft Word or other word processing programs that may add characters. Confirm that there are no extra lines or spaces in the file otherwise additional characters may render the certificate unusable. | ||
- | |||
- | Enter the following command to import your TC Trust SSL certificate (certreq.csr is the alias specified during CSR creation): | ||
- | |||
- | keytool -import -alias server.crt -file server.crt -keystore keystore.key | ||
- | |||
- | </ |