debian tomcat boot services

tomcat-5.5.tar.gz
Unzip to / root/tomcat-5.5
1, add a stand-alone tomcat service, the command is as follows:
useradd-d / root/tomcat-5.5-s / usr / sbin / nologin tomcat
Set tomcat service tomcat user permissions
chown-R tomcat: tomcat / root/tomcat-5.5
2, the installation jsvc
cd / root/tomcat-5.5/bin
tar xvfz jsvc.tar.gz
cd jsvc-src
sh support / buildconf.sh
Successful, the terminal will print
support / buildconf.sh: configure script generated successfully
Install autoconf (Autoconf is a tool used to generate shell script, the script can be generated through the implementation of the makefile, it is suitable for the machine type of makefile.)
apt-get install autoconf
After installation is complete
3, cd / root/tomcat-5.5/bin/jsvc-src
chmod 755 configure
. / Configure-with-java = / usr/lib/jvm/java-1.5.0-sun (JDK installation directory)
If this step in the error (configure: error: C compiler cannot create executables)
Install gcc
apt-get install gcc
apt-get install g + +
Until the last step in the implementation of successful
apt-get install make
Make a successful installation, the implementation of the
make
If g + +, debian source does not, use the following sources
deb http://ftp.hk.debian.org/debian/ stable main
deb-src http://ftp.hk.debian.org/debian/ stable main
make later, there was no error, the installation is successful
4, set the startup script
cp / root/tomcat-5.5/bin/jsvc-src/native/Tomcat5.sh / etc / init.d / tomcat
Modify / etc / init.d / tomcat file:

Quote

#! / Bin / sh
################################################## ############################
#
# Copyright 2004 The Apache Software Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# Http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# Distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# Limitations under the License.
################################################## ############################
#
# Small shell script to show how to start / stop Tomcat using jsvc
# If you want to have Tomcat running on port 80 please modify the server.xml
# File:
#
# <! - Define a non-SSL HTTP/1.1 Connector on port 80 ->
# <Connector className = "org.apache.catalina.connector.http.HttpConnector"
# Port = "80" minProcessors = "5" maxProcessors = "75"
# EnableLookups = "true" redirectPort = "8443"
# AcceptCount = "10" debug = "0" connectionTimeout = "60000" />
#
# That is for Tomcat-5.0.x (Apache Tomcat/5.0)
#
# Adapt the following lines to your configuration
JAVA_HOME = / usr/lib/jvm/java-1.5.0-sun
CATALINA_HOME = / root/tomcat-5.5/tomcat-5.5
DAEMON_HOME = / root/tomcat-5.5/tomcat-5.5/bin
TOMCAT_USER = tomcat

CATALINA_OPTS = "-Djava.library.path = / home / jfclere / jakarta-tomcat-connectors / jni / native / .libs"
CLASSPATH = \
$ JAVA_HOME / lib / tools.jar: \
$ CATALINA_HOME / bin / commons-daemon.jar: \
$ CATALINA_HOME / bin / bootstrap.jar

case "$ 1" in
start)
#
# Start Tomcat
#
$ DAEMON_HOME / jsvc-src / jsvc \
-User $ TOMCAT_USER \
-Home $ JAVA_HOME \
-Dcatalina.home = $ CATALINA_HOME \
-Dcatalina.base = $ CATALINA_BASE \
-Djava.io.tmpdir = $ TMP_DIR \
-Wait 10 \
-Pidfile $ PID_FILE \
-Outfile $ CATALINA_HOME / logs / catalina.out \
-Errfile '& 1' \
$ CATALINA_OPTS \
-Cp $ CLASSPATH \
org.apache.catalina.startup.Bootstrap
#
# To get a verbose JVM
#-Verbose \
# To get a debug of jsvc.
#-Debug \
exit $?
;;

stop)
#
# Stop Tomcat
#
$ DAEMON_HOME / src / native / unix / jsvc \
-Stop \
-Pidfile $ PID_FILE \
org.apache.catalina.startup.Bootstrap
exit $?
;;

*)
echo "Usage tomcat.sh start / stop"
exit 1;;
esac

5, with the update-rc.d to run-level changes
update-rc.d tomcat defaults 99

分类:OS 时间:2010-05-31 人气:260
分享到:
blog comments powered by Disqus

相关文章

  • samba installation source (tar.gz) 2011-05-14

    The core is two samba daemons smbd and nmbd process during a server start to stop running. Smbd and nmbd to use the full configuration information are all stored in the smb.conf file. Smb.conf smbd and nmbd to the description of two daemons output nothing

  • linux source code installation installation rpm.tar.gz experience 2011-01-21

    rpm package installation package if there is interdependence can install multiple rpm packages Such as: rpm-i asdf.rpm asdf.rpm tar.gz source package installation time .. If the. / Configure can not make the situation after .. look out. / Configure the la

  • JDK installation and setup 2010-10-21

    Sun JDK installation There are basically two ways: 1. Through the Ubuntu package management tools provided by the installation Ubuntu in the packages in the warehouse include a JDK installation, as long as the sources.list settings are correct, by apt-get

  • ubuntu10.10 install sun jdk and eclipse 2011-09-17

    One. Sun jdk installation and configuration 1 download jdk, I downloaded: jdk-6u13-linux-i586.bin (2) to set the executable permission sudo chmod + x jdk-6u13-linux-i586.bin 3 installation (I installed in / usr / java under the) Copied to the directo

  • JDK installation configuration 2010-03-27

    JDK installation configuration Description: JDK installation is divided into windows and linux operating systems such as Alto, the other server or installation. Side of the article involves JAVA-based learning to learn. If you want to install the tom ...

  • jdk installation and configuration 2010-04-06

    I. Introduction JDK (Java Development Kit) that the java development kits. Include: java runtime environment jre java virtual machine jvm java run api JDK installation directory consists of: bin development tools: to help you develop, implement, debu ...

  • Ubuntu 10.10 Development Environment configuration (c) Install Sun JDK 2010-10-24

    And most, like Linux, the general default installation of Open JDK, the Internet if you just see the film entertainment Han, and that certainly do not bother, but If you want to develop JAVA, or honestly installation Sun JDK. Fortunately, in the futu

  • linux installation process under the JDK installation 2010-05-03

    1. Download jdk-6u20-linux-i586-rpm.bin copied to / usr / local / directory 2. Enter cd / usr / local / 3. Increase the implementation of the permission chmod + x jdk-6u20-linux-i586-rpm.bin 4. The installation command ./jdk-6u20-linux-i586-rpm.bin A ...

  • mysql-5.1.40-linux-i686-glibc23.tar.gz installation notes 2011-04-15

    mysql-5.1.40-linux-i686-glibc23.tar.gz installation notes 1 First, add the mysql user group Shell Code shell> groupadd mysql 2 Add the mysql user and mysql user group assigned to Shell Code shell> useradd -g mysql mysql 3 Extract the mysql-vers

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.336 (s). 12 q(s)