ubuntu 安装tomcat6

本文介绍如何在Ubuntu 11.10系统中安装并配置Tomcat6服务器,包括使用apt-get安装Tomcat及相关组件,启动、停止及重启Tomcat服务的方法,配置管理员页面及更改Tomcat运行端口等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在Ubuntu11.10上安装Tomcat6

 

sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples

 

 

Start tomcat server

sudo /etc/init.d/tomcat6 start

Stop tomcat server

sudo /etc/init.d/tomcat6 stop

Restart tomcat server

sudo /etc/init.d/tomcat6 restart

Get tomcat server status

sudo /etc/init.d/tomcat6 status

After installation type http://localhost:8080  or http://localhost:8080/examples/servlets/ in your browser.Now you should see tomcat welcome page

 

* To enable admin web based features add the following lines to your /etc/tomcat6/tomcat-user.xml

<role rolename="manager"/>
<role rolename="admin"/>
<user name="admin" password="secret_password" roles="manager,admin"/>

* you should be able to see your manage page here http://your_ip_goes_here:8080/manager/html

* log in with the name and password you just set in /etc/tomcat6/tomcat-users.xml

* ls /var/lib/tomcat6 directory. you should see these directories conf, logs, webapps, work

 

Change tomcat server to run on port 80

If you want to Change tomcat server to run on port 80 follow this procedure

You need to edit the /etc/tomcat6/server.xml file

gedit /etc/tomcat6/server.xml

 

对于手动安装配置:

 

前提:

安装 jdk,配置 jdk,

* 下载 tomcat

如 apache-tomcat-6.0.35.zip

* 解压 tomcat 到适当位置

* 命令行进入 tomcat_home/bin

* 为所有 .sh 文件添加 执行权限

sudo chmod +x *.sh

* (这一步也可忽略)为 tomcat 设置 jdk

编辑 tomcat_home/bin/setclasspath.sh,

在 正式代码前 加上:

export JAVA_HOME=/usr/java/jdk1.6.0_13

等号后的值根据自己具体的jdk位置而设定,

* 启动 tomcat

./shutdown.sh

./startup.sh

* 通过 http://localhost:8080 访问

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值