debian tomcat boot services

sponsored links
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
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of debian tomcat boot services

  • hibernate Technical Study Notes (first)

    Introduction: Model does not match (impedance mismatch) java object-oriented language, object model, its key concepts are: inheritance, association, polymorphism, etc.; database is the relational model, its key concepts are: tables, primary keys, for ...

  • Rails2.0.2 change the default DB adpter

    In Rails2.0.2 rails demo ... ... MissingSourceFile in SayController # hello no such file to load - sqlite3 RAILS_ROOT: / home / kenb / rails-projects / demo ... ... Checked config / database.yml, adpter default is set become the sqlite3. Check the ra ...

  • Answer: After 2.2 upgrade mysql question-driven

    windows installed after the mysql gem error, error is approximately: ArgumentError (NULL pointer given): (eval): 3: in `each_hash ' (eval): 3: in `all_hashes' This is feeling under the windows of the question if the mysql gem version libmysql ...

  • ROR resources

    Ruby Web site resources: ruby official website: http://www.ruby-lang.org ruby doc official website: http://www.ruby-doc.org rubyonrails official website: http://www.rubyonrails.org programming ruby online edition (Ruby studying the "Bible") ...

  • hibernate using c3p0 connection pooling

    Private http://www.lifevv.com/tenyo/doc/20070605102040991.html c3p0 for open source's JDBC connection pool, with the release hibernate. This article describes how to use the hibernate configuration in c3p0. c3p0 connection pool configuration is v ...

  • Hibernate configuration parameters hibernate.hbm2ddl.auto

    Hibernate in the configuration file: <properties> <property name="hibernate.hbm2ddl.auto" value="create" /> </ properties> Parameter Description: validate load hibernate, the authentication to create a database t ...

  • What is the appfuse

    First, Appfuse brief introduction Matt Raible are Appfuse developed a guiding entry-level J2EE framework, how to integrate its popular Spring, Hibernate, ibatis, struts, Xdcolet, junit, etc. give the basic framework of the model, the latest version 1.7 is

  • In the servlet use Bean

    According to Sun's definition, JavaBean is a reusable software components. In fact JavaBean is a Java class, through the package into a property and methods of treatment of a function or a business object, referred to as bean. Because JavaBean is ...

  • Learn Java flow

    Related Articles: J2EE without EJB Introducing to Spring Framework (English revised edition) J2EE without EJB caused consider Recommend circles: reading space More related recommend Java Learning Path (1), tools, articles First, JDK (Java Development Kit)

  • Hibernate secondary cache

    Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries