linux下安装tomcat为系统服务


linux下安装tomcat为系统服务
 
1. 环境准备
gcc autoconf jdk
 
2. 配置环境变量
 
cd /opt
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.tar.gz
tar zxvf apache-tomcat-7.0.42.tar.gz
 
vi /etc/profile

 
. /etc/profile
 
3. 编译jsvc
 
cd $CATALINA_HOME/bin
tar xvfz commons-daemon-native.tar.gz
cd commons-daemon-1.0.x-native-src/unix
./configure
make
cp jsvc ../.
 
4. 制作daemon
 
cp $CATALINA_HOME/bin/daemon.sh /etc/init.d/tomcat
vi /etc/init.d/tomcat
 
1>设置chkconfig配置
 
2>设置系统服务的环境变量
 

3>修改tomcat用户 

 
修改完tomcat脚本后就可以添加系统服务了:
chkconfig --add tomcat
chkconfig tomcat on
 
启动tomcat:
service tomcat start

相关内容

    暂无相关文章