Creato da pastuweb.com
Share My Page
My Social Accounts
Account FaceBook Account LinkedIn Account Twitter Account Google Plus Account Git Hub

Apache Tomcat is a Servlet / JSP engine that does nothing to contain and run your Java Servlet and Java Server Page (JSP).

It is the only Application Server Servlet / JSP in circulation.

Enable Universe and Multiverse repositories of Ubuntu.
First install, Java jre and jdk packages.
Download from the site http://tomcat.apache.org/ the latest version of Tomcat, the 6.

wget http://mirrors.publicshout.org/apache/tomcat/tomcat-6/v6.0.7/bin/apache-tomcat-6.0.7.tar.gz

tar xzfv apache-tomcat-6.0.7.tar.gz

Copy to /usr/local directory and then extracted to create a symbolic link /usr/local/tomcat:

$ sudo cp -r apache-tomcat-6.0.7 /usr/local/

$ sudo ln -s /usr/local/apache-tomcat-6.0.7/ /usr/local/tomcat


Create a script to init.d to ensure that the Tomcat daemon is activated at startup.
Create the file /etc/init.d/tomcat

#
# Startup script for the Tomcat server
#
# chkconfig: - 83 53
# description: Starts and stops the Tomcat daemon.
# processname: tomcat
# pidfile: /var/run/tomcat.pid
# See how we were called.
case $1 in
        start)
                export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/
                export CLASSPATH=/usr/local/tomcat/lib/servlet-api.jar
                export CLASSPATH=/usr/local/tomcat/lib/jsp-api.jar
                export JRE_HOME=/usr/lib/jvm/java-1.5.0-sun/
                echo "Tomcat is started"
                sh /usr/local/tomcat/bin/startup.sh
        ;;
        stop)
                export JRE_HOME=/usr/lib/jvm/java-1.5.0-sun/
                sh /usr/local/tomcat/bin/shutdown.sh
                echo "Tomcat is stopped"
        ;;
        restart)
                export JRE_HOME=/usr/lib/jvm/java-1.5.0-sun/
                sh /usr/local/tomcat/bin/shutdown.sh
                echo "Tomcat is stopped"
                sh /usr/local/tomcat/bin/startup.sh
                echo "Tomcat is started"
        ;;
        *)
                echo "Usage: /etc/init.d/tomcat start|stop|restart"
        ;;
esac
exit 0


Let's give them the proper permits and make it executable:
$ sudo chmod 755 /etc/init.d/tomcat

$ sudo update-rc.d tomcat defaults

We start Tomcat
$ sudo /etc/init.d/tomcat start

At this point, if everything went the right way, aiming at http://localhost:8080 you should have the Tomcat welcome page.

Average (1 Vote)
The average rating is 5.0 stars out of 5.