ubuntu 安装tomcat

0.安装jdk,前面已经装过了:

    http://my.oschina.net/yale8848/blog/168864

1.下载tomcat6.0:

    http://tomcat.apache.org/download-60.cgi

2.创建tomcat目录,可以自定义:

   sudo mkdir /usr/tomcat

   cp apache-tomcat-6.0.37.tar.gz /usr/tomcat

   cd /usr/tomcat

   tar zxvf apache-tomcat-6.0.37.tar.gz

   生成apache-tomcat-6.0.37目录

3.建立软连接:

   cd /usr/local

   sudo ln -s /usr/tomcat/apache-tomcat-6.0.37 tomcat6

4.启动:

   /usr/local/tomcat6/bin/startup.sh

   出现类似如下,启动正确:

         Using CATALINA_BASE:   /usr/local/tomcat6
         Using CATALINA_HOME:   /usr/local/tomcat6
         Using CATALINA_TMPDIR: /usr/local/tomcat6/temp
         Using JRE_HOME:        /usr/java/jdk1.6.0_38
         Using CLASSPATH:       /usr/local/tomcat6/bin/bootstrap.jar

   如果报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

   说明环境变量有误:

   可以修改sudo gedit /usr/tomcat/apache-tomcat-6.0.37/bin/catalina.sh

    在文档开始添加:

    JAVA_HOME="/usr/java/jdk1.6.0_38"
    export JAVA_HOME

    重新启动:/usr/local/tomcat6/bin/startup.sh

5.关闭:

    /usr/local/tomcat6/bin/shutdown.sh



你可能感兴趣的:(tomcat,安装,ubuntu)