Modifiez le fichier de configuration configuration java_home
vi /usr/local/tomcat/apache-tomcat-6.0.48/bin/setclasspath.sh
Augmentation de la position du cadre rouge
export JAVA_HOME = / usr / java / jdk1.7.0_79
Exécuter ( créer un fichier)
vi /etc/rc.d/init.d/tomcat
Copiez le contenu dans le fichier
#! / bin / bash
#
# /etc/rc.d/init.d/tomcat
# script init pour les pré-requis tomcat
#
# nom du processus: tomcat
# description: tomcat est un serveur j2se
# chkconfig: 2345 86 16
# description: démarrez le moteur de servlet Tomcat.
if [-f /etc/init.d/functions]; alors
. /etc/init.d/functions
elif [-f /etc/rc.d/init.d/functions]; alors
. /etc/rc.d/init.d/functions
autre
echo -e "/ atomcat: impossible de localiser les fonctions lib. Impossible de continuer."
sortie -1
être
RETVAL = $?
CATALINA_HOME = "/ usr / local / tomcat / apache-tomcat-6.0.48 / "
cas "$ 1" dans
début)
if [-f $ CATALINA_HOME / bin / startup.sh];
alors
echo $ "Démarrage de Tomcat"
$ CATALINA_HOME / bin / startup.sh
être
;;
Arrêtez)
if [-f $ CATALINA_HOME / bin / shutdown.sh];
alors
echo $ "Arrêter Tomcat"
$ CATALINA_HOME / bin / shutdown.sh
être
;;
*)
echo $ "Utilisation: $ 0 {start | stop}"
sortie 1
;;
esac
exit $ RETVAL
Exécuter
chmod 775 /etc/rc.d/init.d/tomcat
Transformez Tomcat en fichier exécutable
S'inscrire en tant que service et démarrer automatiquement
Exécuter
chkconfig tomcat on
Redémarrez le système pour tester
Exécuter
redémarrer