上一篇记录和分享了jdk1.6 在Ubuntu 16.04.2 环境下的安装配置,本文开始安装和配置tomcat 6
2 安装tomcat
2.2 传入文件
可以在ubunbu上直接下载,也可以在mac上下载完成,通过scp上传到服务器。
scp apache-tomcat-6.0.53.tar.gz asialantao@s2.asialantao.com:/home/asialantao
asialantao@s2.asialantao.com's password:
apache-tomcat-6.0.53.tar.gz 100% 6944KB 6.8MB/s 00:00
2.3 解压文件
$ tar -zxv -f apache-tomcat-6.0.53.tar.gz
apache-tomcat-6.0.53/bin/catalina.sh
apache-tomcat-6.0.53/bin/daemon.sh
apache-tomcat-6.0.53/bin/digest.sh
apache-tomcat-6.0.53/bin/setclasspath.sh
apache-tomcat-6.0.53/bin/shutdown.sh
apache-tomcat-6.0.53/bin/startup.sh
...
2.4 启动,停止tomcat 6
进入目录,然后使用startup.sh启动
$ cd apache-tomcat-6.0.53/bin
启动命令
$ ./startup.sh
Using CATALINA_BASE: /home/asialantao/apache-tomcat-6.0.53
Using CATALINA_HOME: /home/asialantao/apache-tomcat-6.0.53
Using CATALINA_TMPDIR: /home/asialantao/apache-tomcat-6.0.53/temp
Using JRE_HOME: /usr/local/java/jdk1.6.0_45
Using CLASSPATH: /home/asialantao/apache-tomcat-6.0.53/bin/bootstrap.jar
停止命令
$ ./shutdown.sh
如果没有配置好环境变量,则出现如下错误信息
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
需要返回上一篇配置好jdk 6
2.5 检验
$ ./version.sh
Using CATALINA_BASE: /home/asialantao/apache-tomcat-6.0.53
Using CATALINA_HOME: /home/asialantao/apache-tomcat-6.0.53
Using CATALINA_TMPDIR: /home/asialantao/apache-tomcat-6.0.53/temp
Using JRE_HOME: /usr/local/java/jdk1.6.0_45
Using CLASSPATH: /home/asialantao/apache-tomcat-6.0.53/bin/bootstrap.jar
Server version: Apache Tomcat/6.0.53
Server built: Apr 2 2017 07:25:00 UTC
Server number: 6.0.53.0
OS Name: Linux
OS Version: 4.4.0-83-generic
Architecture: amd64
JVM Version: 1.6.0_45-b06
JVM Vendor: Sun Microsystems Inc.
也可以在浏览器访问8080端口,或者在命令行模式,可以使用curl
http://localhost:8080