Ubuntu 10.10配置Tomcat6

原创
2011/02/27 20:03
阅读数 1K

1tomcat6下载

地址:http://archive.apache.org/dist/tomcat/tomcat-6/

版本:v6.0.29

2、在/usr/local/share下创建tomcat6目录

sudo mkdir /usr/local/share/tomcat6

3、复制安装文件到/usr/local/share/tomcat6/目录下,并解压

sudo cp /home/silver/下载/apache-tomcat-6.0.29.tar.gz /usr/local/share/tomcat6/ apache-tomcat-6.0.29.tar.gz

sudo tar -zxvf apache-tomcat-6.0.29.tar.gz

4、分别配置startup.shshutdown.sh文件

sudo gedit /usr/local/share/tomcat6/apache-tomcat-6.0.29/bin/startup.sh

sudo gedit /usr/local/share/tomcat6/apache-tomcat-6.0.29/bin/shutdown.sh

exec "$PRGDIR"/"$EXECUTABLE" start "$@"之前加入以下配置内容

#environment varible for tomcat

JAVA_HOME=/usr/lib/jvm/java/jdk1.6.0_22

JRE_HOME=/usr/lib/jvm/java/jdk1.6.0_22/jre

PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

CLASSPATH=.:JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

TOMCAT_HOME=/usr/local/share/tomcat6/apache-tomcat-6.0.29

5、测试是否能正常使用

cd /usr/local/share/tomcat6/apache-tomcat-6.0.29/bin/

sudo ./startup.sh

输出:

Using CATALINA_BASE: /usr/local/share/tomcat6/apache-tomcat-6.0.29

Using CATALINA_HOME: /usr/local/share/tomcat6/apache-tomcat-6.0.29

Using CATALINA_TMPDIR: /usr/local/share/tomcat6/apache-tomcat-6.0.29/temp

Using JRE_HOME: /usr/lib/jvm/java/jdk1.6.0_22

Using CLASSPATH: /usr/local/share/tomcat6/apache-tomcat-6.0.29/bin/bootstrap.jar

则表示服务已经正常启动,输入http://localhost:8080/查看

6、关闭服务

sudo ./shutdown.sh

7、配置conf/server.xml文件

cd /usr/local/share/tomcat6/apache-tomcat-6.0.29/conf

sudo gedit server.xml

编辑

<Connector port="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" />

将端口改成8090,添加URIEncoding="UTF-8"以支持中文参数传递处理

<Connector port="8090" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" URIEncoding="UTF-8"/>

展开阅读全文
打赏
0
2 收藏
分享
加载中
vv2
keep
2012/04/09 11:39
回复
举报
更多评论
打赏
1 评论
2 收藏
0
分享
返回顶部
顶部