(教學)在Ubuntu裡建立Apache with Tomcat 服務-1

這裡會有一系列Apache 在前而Tomcat在後的JSP Service

包含MySQL及JMagick及ImageMagick的安裝

這裡先介紹安裝Apache MySQL及JDK 6跟tomcat 5

環境是Ubuntu 9.10 (Linux)

1.安裝apache

#sudo apt-get install apache2

2.安裝mysql

#sudo get-get install mysql-server

這裡需要設定MySQL的root密碼

3.安裝java jdk

#sudo apt-get install sun-java6-jdk
#sudo vi /etc/profile

加如以下(放到最後一行的前一行)
export JAVA_HOME=/usr/lib/jvm/java-6-sun

4.安裝tomcat

#cd etc 
#sudo wget http://ftp.tcc.edu.tw/pub/Apache/tomcat/tomcat-5/v5.5.28/bin/apache-tomcat-5.5.28.tar.gz 
#sudo tar -zxvf apache-tomat-5.5.28.tar.gz 
#sudo mv apache-tomcat-5.5.28 tomcat5 
#sudo chmod 755 /etc/tomcat5/bin/*.sh 
#sudo vi /etc/init.d/tomcat5

內容如下:

# Tomcat auto-start 
# 
# description: Auto-starts tomcat 
# processname: tomcat 
# pidfile: /var/run/tomcat.pid

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in 
start) 
        sh /etc/tomcat5/bin/startup.sh 
        ;; 
stop)  
        sh /etc/tomcat5/bin/shutdown.sh 
        ;; 
restart) 
        sh /etc/tomcat5/bin/shutdown.sh 
        sh /etc/tomcat5/bin/startup.sh 
        ;; 
esac   
exit 0
#sudo chmod 755 /etc/init.d/tomcat5 
#sudo update-rc.d tomcat5 defaults 

重開機或是sudo /etc/init.d/tomcat5 start 
測試http://localhost:8080

One thought to “(教學)在Ubuntu裡建立Apache with Tomcat 服務-1”

發表迴響