Instalar Tomcat 7 sobre Ubuntu 12
Download and install:
Download from zip: http://tomcat.apache.org/download-70.cgi
tar xvzf apache-tomcat-7.0.8.tar.gz
sudo mv apache-tomcat-7.0.8/ /usr/share/tomcat7
#sudo geany /etc/environment
#sudo nano /etc/environment
sudo vim /etc/environment
JAVA_HOME="/usr/lib/jvm/jdk1.7.0_71"
JRE_HOME="/usr/lib/jvm/jdk1.7.0_71/jre"
sudo vim /usr/share/tomcat7/bin/catalina.sh
#insert the JAVA_HOME and JRE_HOME after the first line
JAVA_HOME="/usr/lib/jvm/jdk1.7.0_71"
JRE_HOME="/usr/lib/jvm/jdk1.7.0_71/jre"
Configure Users:
sudo geany /usr/share/tomcat7/conf/tomcat-users.xml#Add user into file tomcat-users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="admin"/>
<user username="usuario" password="contrasena" roles="manager-gui,admin-gui,manager,admin,manager-script,admin-script"/>
Configure Bash:
#Add in .bashrc :export CATALINA_HOME=/usr/share/tomcat7
export WEBAPPS_HOME=/usr/share/tomcat7/webapps
alias tomcat_start='sudo /usr/share/tomcat7/bin/startup.sh'
alias tomcat_stop='sudo /usr/share/tomcat7/bin/shutdown.sh'
Start and stop:
#Start server:
#sudo /usr/share/tomcat7/bin/startup.sh
tomcat_start
#Web Test:
http://127.0.0.1:8080/
#Stop server:
#sudo /usr/share/tomcat7/bin/shutdown.sh
tomcat_stop
See the version:
$CATALINA_HOME/bin/version.shUsing CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME: /usr/lib/jvm/jdk1.7.0_71/jre
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.56
Server built: Sep 26 2014 12:08:24
Server number: 7.0.56.0
OS Name: Linux
OS Version: 3.2.0-69-generic
Architecture: amd64
JVM Version: 1.7.0_71-b14
JVM Vendor: Oracle Corporation
View Status:
ps -A | grep java
3453 pts/0 00:00:04 java
(Nota: para matar el proceso podemos usar: kill -9 3453)
ps -ax | grep tomcat7
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
3936 pts/0 Sl 0:04 /usr/lib/jvm/jdk1.7.0_71/jre/bin/java -Djava.util.logging.config.file=/usr/share/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -Xms1024m -Xmx1024m -XX:MaxPermSize=1024m -XX:MaxNewSize=128m -XX:NewSize=128m -XX:SurvivorRatio=128 -XX:MaxTenuringThreshold=0 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:+UseTLAB -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses -Dgrails.env=prod -Dspring.profiles.active=prod -Dport-offset=0 -Djboss.socket.binding.port-offset=0 -Dajp.port=8009 -Djboss.http.port=8080 -Dhttp.maxthreads=1000 -Dshutdown.port=8005 -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/usr/share/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/usr/share/tomcat7/temp org.apache.catalina.startup.Bootstrap start
3979 pts/0 S+ 0:00 grep --color=auto tomcat7
sudo netstat -tapen | grep ":8080 "
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 0 30018 3565/java
Web Admin:
(Nota: put the user and pass located into tomcat-users.xml)
References:
http://diegobenna.blogspot.com.ar/2011/01/install-tomcat-7-in-ubuntu-1010.html
http://www.liquidweb.com/kb/how-to-install-apache-tomcat-7-on-ubuntu-12-04/
No hay comentarios:
Publicar un comentario