Apache+MySQL如何架设我这里就不多说了,只是说说如何安装Tomcat

=========================================

1、首先要确保安装相关的软件

$sudo apt-get install gcc autoconf sun-j2sdk1.5

2、下载tomcat

$wget http://apache.freelamp.com/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9.tar.gz

3、解压tomcat

$sudo tar zxvf jakarta-tomcat-5.5.9.tar.gz -C /opt

$sudo mv /opt/jakarta-tomcat-5.5.9 /opt/tomcat

4、确保在/etc/environment文件中有:(这一步不是很确定是否需要)

>CLASSPATH=/usr/lib/j2sdk1.5-sun/lib

>JAVA_HOME=/usr/lib/j2sdk1.5-sun

5、启动tomcat

$sudo /opt/tomcat/bin/startup.sh

如果能看到下列提示,就表明启动成功了!

>Using CATALINA_BASE: /opt/tomcat

>Using CATALINA_HOME: /opt/tomcat

>Using CATALINA_TMPDIR: /opt/tomcat/temp

>Using JRE_HOME: /usr/lib/j2sdk1.5-sun

6、测试:打开Firefox,在地址栏中输入http://localhost:8080,如果出来Tomcat的缺省界面,说明测试通过!

7、停止Tomcat服务

$sudo /opt/tomcat/bin/shutdown.sh

8、获得MySQLJDBC,在Firefox浏览器的地址栏中输入http: //dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-3.1.10.tar.gz/from/http: //mysql.cbn.net.id/以得到该软件。

9、安装JDBC

$tar -zxvf mysql-connector-java-3.1.10.tar.gz

$sudo cp mysql-connector-java-3.1.10/mysql-connector-java-3.1.10-bin*.jar /usr/lib/j2sdk1.5-sun/lib