在ubuntu下面,我們安裝tomcat可以有兩種方式
[1]用aptitude安裝
aptitude install tomcat6
[2]免安裝版
從apache tomcat 網(wǎng)站下載apache-tomcat-6.0.20 然后直接解壓
第一種方式,可以用/etc/init.d/tomcat6實(shí)現(xiàn)對(duì)tomcat的啟動(dòng)和關(guān)閉
那么第二種方式呢,就只能 cd /opt/apache-tomcat-6.0.20,然后
bin/startup.sh來(lái)啟動(dòng),用bin/shutdown.sh來(lái)關(guān)閉。麻煩在于你每次都需要先進(jìn)入目錄,才能啟動(dòng)和關(guān)閉。
一個(gè)簡(jiǎn)便的方式,可以如下實(shí)現(xiàn)和第一種方式一樣的結(jié)果。
其實(shí)很簡(jiǎn)單。
cd /zy/green/apache-tomcat-6.0.20/
#./bin/startup.sh
case "$1" in
start)
./bin/startup.sh
exit 1;;
stop)
./bin/shutdown.sh
exit 1;;
esac
保存成文件/etc/init.d/tomcat
然后,你就可以用/etc/init.d/start來(lái)啟動(dòng)你的tomcat了,也可以用/etc/init.d/tomcat來(lái)關(guān)閉你的tomcat了。
|----------------------------------------------------------------------------------------|
版權(quán)聲明 版權(quán)所有 @zhyiwww
引用請(qǐng)注明來(lái)源 http://m.tkk7.com/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2010-01-27 18:20
zhyiwww 閱讀(7166)
評(píng)論(0) 編輯 收藏 所屬分類(lèi):
j2ee 、
linux