Created
January 18, 2012 14:36
-
-
Save rodrigomaia/1633260 to your computer and use it in GitHub Desktop.
Install Tomcat on Ubuntu(Ex. para colocar no auto inicializar)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installation | |
- Download e Descompatação | |
wget http://apache.mirror.pop-sc.rnp.br/apache/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz | |
tar xvzf apache-tomcat-6.0.35.tar.gz | |
- Movendo para o local "correto" | |
sudo mv apache-tomcat-6.0.35 /usr/local/tomcat | |
- Adicionar JAVA_HOME ao bashrc | |
vi ~/.bashrc | |
export JAVA_HOME=/usr/lib/jvm/java-6-sun | |
- Automatic Starting | |
sudo vi /etc/init.d/tomcat | |
- Cole o código abaixo no arquivo criado acima | |
# Tomcat auto-start | |
# | |
# description: Auto-starts tomcat | |
# processname: tomcat | |
# pidfile: /var/run/tomcat.pid | |
export JAVA_HOME=/usr/lib/jvm/java-6-sun | |
case $1 in | |
start) | |
sh /usr/local/tomcat/bin/startup.sh | |
;; | |
stop) | |
sh /usr/local/tomcat/bin/shutdown.sh | |
;; | |
restart) | |
sh /usr/local/tomcat/bin/shutdown.sh | |
sh /usr/local/tomcat/bin/startup.sh | |
;; | |
esac | |
exit 0 | |
- Tornando-o executável | |
sudo chmod 755 /etc/init.d/tomcat | |
- Criando links para inicialização automáticasudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat | |
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat | |
PRONTO! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Poderia usar o... update-rc.d tomcat defaults