`
jayghost
  • 浏览: 429390 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

ubuntu 安装tomcat6

 
阅读更多

在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 访问

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics