安装 1)下载apache-tomcat-6.0.20.tar.gz //版本号不同而不同 2) tar -zxvf apache-tomcat-6.0.20.tar.gz //解压 3) cp -R apache-tomcat-6.0.20 /usr/local/tomcat //拷贝apache-tomcat-6.0.20到/usr/local/下并重命名为tomcat 4) /usr/local/tomcat/bin/startup.sh //启动tomcat 显示如下: Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TEMDIR: /usr/local/tomcat/temp Using JAVA_HOME: /usr/java/jdk1.6.0_14该项根据版本不同而不同 到此tomcat已经安装完成,现在使用浏览器访问 http://localhost:8080,出现tomcat默认页面,说明已经安装成功。 tomcat的安装目录就在/usr/local/tomcat下面到该目录下进行配置即可,与Windows下相同的目录结构 启动 sudo ./startup.sh 停止 sudo ./shutdown.sh 打成系统服务 cd /etc/init.d vi tomcat Bash代码 #!/bin/bash # description: Tomcat Start Stop Restart # processname: tomcat # chkconfig: 234 20 80 JAVA_HOME=/usr/java/jdk1.6.0_30 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CATALINA_HOME=/usr/share/apache-tomcat-6.0.35 case $1 in start) sh $CATALINA_HOME/bin/startup.sh ;; stop) sh $CATALINA_HOME/bin/shutdown.sh ;; restart) sh $CATALINA_HOME/bin/shutdown.sh sh $CATALINA_HOME/bin/startup.sh ;; esac exit 0 chmod 755 tomcat chkconfig --add tomcat chkconfig --level 2345 tomcat on chkconfig --list tomcat 服务命令 service tomcat start service tomcat restart service tomcat stop (责任编辑:IT) |