Instalar Apache Tomcat

Por 9.99€ al mes tendrás acceso completo a todos los cursos. Sin matrícula ni permanencia.

  1. Descargamos apache Tomcat
  2. Debemos crear un script de arranquesudo gedit /etc/init.d/tomcatque tendrá el siguiente código, en el que sustituiremos el valor de la variable CATALINA_HOME por la ubicación de Apache Tomcat#!/bin/sh # /etc/init.d/tomcat # starts the Apache Tomcat service ### BEGIN INIT INFO # Provides: tomcat # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # X-Interactive: true # Short-Description: Start/stop tomcat application server ### END INIT INFO export CATALINA_HOME="/home/pi/Tomcat/apache-tomcat-8.0.41" case "$1" in start) if [ -f $CATALINA_HOME/bin/startup.sh ]; then echo $"Starting Tomcat" /bin/su pi $CATALINA_HOME/bin/startup.sh fi ;; stop) if [ -f $CATALINA_HOME/bin/shutdown.sh ]; then echo $"Stopping Tomcat" /bin/su pi $CATALINA_HOME/bin/shutdown.sh fi ;; *) echo $"Usage: $0 {start|stop}" exit 1 ;; esac
  3. Hacemos el fichero ejecutable:sudo chmod 755 /etc/init.d/tomcat
  4. Damos permisos de ejecución a catalina.shsudo chmod +x [ruta_apache_tomcat]/bin/catalina.sh
  5. Arrancamos el servidor:sudo /etc/init.d/tomcat start
  6. Si queremos que este script se ejecute siempre que arranquemos la raspbian:sudo update-rc.d tomcat defaults

Subir una aplicación media el administrador de aplicaciones

  1. Debemos tener un usuario con permisos, para ello, editaremos el fichero:conf/tomcat-users.xml
  2. y le añadimos el siguiente código:<role rolename="manager"/> <user username="root" password="pp" roles="manager-gui"/>
  3. Paramos y arrancamos el servidor:sudo /etc/init.d/tomcat stop sudo /etc/init.d/tomcat start

Por 9.99€ al mes tendrás acceso completo a todos los cursos. Sin matrícula ni permanencia.