debian安装tomcat
如果没有执行:apt-getinstallsun-java6-jdk
2,下载tomcat安装包3,复制文件到/usr/local cp -r apache-tomcat-6.0.26 /usr/local
4,切换到tomcat的/bin 目录下 ,执行 ./startup.sh 启动tomcat
5,编辑启动脚本
vi/etc/init.d/tomcat
输入:
#Tomcatauto-start
#
#description:Auto-startstomcat
#processname:tomcat
#pidfile:/var/run/tomcat.pid
exportJAVA_HOME=/usr/lib/jvm/java-6-sun
case$1in
start)
sh/usr/local/tomcat/bin/startup.sh
;;
stop)
sh/usr/local/tomcat/bin/shutdown.sh
;;
restart)
sh/usr/local/tomcat/bin/shutdown.sh
sh/usr/local/tomcat/bin/startup.sh
;;
esac
exit0
6,设置执行权限:
chmod755/etc/init.d/tomcat
7,设置开机启动
sudoln-s/etc/init.d/tomcat/etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat注: 可能需要修改 /etc/hosts 内容 ,如果内容 192.168.50.165 localhost