linux 非root用户安装 jdk 和 tomcat


四、部署 tomcat

1、将apache-tomcat-6.0.20.tar.gz上传到服务器上

2、解压文件,出现目录 apache-tomcat-6.0.20

[plain]  view plain  copy
  1. [sgmm@lnx_test ~]$ tar zxvf apache-tomcat-6.0.20.tar.gz  
3、设置tomcat的环境变量。
[plain]  view plain  copy
  1. [sgmm@lnx_test ~]$ vi .bash_profile  
增加如下:
[plain]  view plain  copy
  1. export CATALINA_BASE=/home/sgmm/apache-tomcat-6.0.20  
  2. export CATALINA_HOME=/home/sgmm/apache-tomcat-6.0.20  
最终 .bash_profile 文件的内容为:
[plain]  view plain  copy
  1. # .bash_profile  
  2.   
  3. # Get the aliases and functions  
  4. if [ -f ~/.bashrc ]; then  
  5.     . ~/.bashrc  
  6. fi  
  7.   
  8. # User specific environment and startup programs  
  9. JAVA_HOME=/home/sgmm/jdk1.6.0_13  
  10. CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib   
  11. PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin   
  12. export PATH CLASSPATH JAVA_HOME  
  13. export CATALINA_BASE=/home/sgmm/apache-tomcat-6.0.20  
  14. export CATALINA_HOME=/home/sgmm/apache-tomcat-6.0.20  
4、使环境变量生效
[plain]  view plain  copy
  1. [sgmm@lnx_test ~]$ source ~/.bash_profile   
5、切换到tomcat 解压后的 bin目录下,执行如下命令启动 tomcat 服务
[plain]  view plain  copy
  1. [sgmm@lnx_test bin]$ ./startup.sh   
打印出以下信息,说明启动成功。
[plain]  view plain  copy
  1. Using CATALINA_BASE:   /home/sgmm/apache-tomcat-6.0.20  
  2. Using CATALINA_HOME:   /home/sgmm/apache-tomcat-6.0.20  
  3. Using CATALINA_TMPDIR: /home/sgmm/apache-tomcat-6.0.20/temp  
  4. Using JRE_HOME:       /home/sgmm/jdk1.6.0_13  

6、使用 ps -ef|grep tomcat 可以查看tomcat进程,并使用 kill -9 进程号杀掉进程

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值