Archive for 十一月 18th, 2007

Ubuntu Linux 架設 Tomcat 伺服器

野部看了整個下午的 Tom and Jerry (湯姆貓與傑利鼠) 的卡通。託可愛的湯姆貓的福,讓我解決了一個長久的疑問:Ubuntu下要如何配置 Tomcat 伺服器。
Tomcat 伺服器是一個很方便的 JSP 網頁伺服器,之前一直想要架設架不起來,看完卡通後靈感一來,沒想到一下就弄好了,之前抓不到竅門弄好久都弄不好,現在只要按照下列步驟安裝便可:

用 Synaptic 套件管理程式,安裝 tomcat5.5、tomcat5.5-admin、tomcat5.5-webapps這3個套件。
開瀏覽器,Tomcat預設首頁是http://localhost:8180/
萬一沒有顯示沒有關係,去終端機輸入 sudo /etc/init.d/tomcat5.5 restart 就可以啟動伺服器,此時應該可以看到預設首頁了。
進去Admin或Manager介面要修改一個檔案,終端機輸入
gedit /usr/share/tomcat5.5/conf/tomcat-users.xml
新增一行 <user username=”admin” password=”您的管理密碼” roles=”manager”/>
執行第三步驟重新啟動Tomcat 伺服器。

以下為參考到的連結:

Install Tomcat 5.5 in Debian and Ubuntu
http://my.opera.com/subjam/blog/install-tomcat-5-5-in-debian-and-ubuntu
Problem Logging into Tomcat Manager
http://www.jguru.com/forums/view.jsp?EID=1087051
problems with tomcat5.5 on debian (這個算是Optional,因為野部沒有設定到這個也可動作)
http://blog.pigwidgeon.de/index.php/2007/08/27/problems-with-tomcat55-on-debian/