Jsvc守护进程

1.添加tomcat用户及用户组

[root@V_wangshenweb01 ~]# groupadd tomcat

[root@V_wangshenweb01 ~]# useradd -g tomcat tomcat

2.改变tomcat的用户及用户组

[root@V_wangshenweb01 ~]# chown -R tomcat  /usr/local/tomcat

[root@V_wangshenweb01 ~]# chgrp -R tomcat  /usr/local/tomcat

3.切换用户为tomcat

[root@V_wangshenweb01 ~]# su  tomcat

4.进入tomcat下的bin目录,解压 commons-daemon-native.tar.gz

[tomcat@V_wangshenweb01 bin]# cd /usr/local/tomcat7.0.57/bin/

[tomcat@V_wangshenweb01 bin]# tar -zxvf commons-daemon-native.tar.gz

5.得到文件commons-daemon-1.0.15-native-src,进入nuix目录

[tomcat@V_wangshenweb01 bin]# cd commons-daemon-1.0.15-native-src/unix/

6.发现configure配置文件并编译,做如下操作

[tomcat@V_wangshenweb01 unix]# chmod 777 configure

[tomcat@V_wangshenweb01 unix]# ./configure

[tomcat@V_wangshenweb01 unix]# make

7.编译完成后出现jsvc文件夹 复制到/usr/local/tomcat7.0.57/bin

[tomcat@V_wangshenweb01 unix]# cp jsvc /usr/local/tomcat7.0.57/bin

8.把bin目录下的daemon.sh复制到/etc/init.d/tomcat

注:此时要把用户切换为root,否则会提示权限不够

[root@V_wangshenweb01 bin]# cp ./daemon.sh /etc/init.d/tomcat

9.修改/etc/init.d/tomcat

[root@V_wangshenweb01 bin]# vi etc/init.d/tomcat

#!/bin/sh下添加以下内容

# chkconfig:2334 90 15

# description Tomcat-en Manager

# resolve links - $0 may be a softlink下添加以下内容

#jdk的位置

JAVA_HOME=/usr/java/jdk1.7.0_79

#tomcat的位置

CATALINA_HOME=/usr/local/tomcat

DAEMON_HOME=$CATALINA_HOME/bin

#使用tomcat身份启动

TOMCAT_USER=tomcat

CATALINA_BASE=$CATALINA_HOME

CATALINA_OPTS="-server -XX:MaxPermSize=512m -XX:MaxNewSize=512m -Xmx2048m"

保存并退出(wq

7.更改tomcat权限

[root@V_wangshenweb01 bin]# chmod 777 /etc/init.d/tomcat

8.添加tomcat服务

[root@V_wangshenweb01 bin]# chkconfig --add tomcat

9.查看服务

[root@V_wangshenweb01 bin]# chkconfig --list|grep tomcat

tomcat         0:off   1:off 2:on 3:on 4:on 5:off   6:off

10.启动tomcat

[tomcat@V_wangshenweb01 bin]# service tomcat start

[tomcat@V_wangshenweb01 bin]# service tomcat stop
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值