Install tomcat to integrate jsvc and apr and configure it as a background service (CentOS x. x. x)

Source: Internet
Author: User

Add User
# Groupadd xz_server
# Useradd-g xz_server xz_lan
Set the user password to 4 tomcat
# Passwd xz_lan

Install JDK
# Cd/var/tomcat/res
# Tar-zvxf jdk-7u5-linux-x64.tar.gz
Mv jdk1.7.0 _ 05/var/tomcat/jdk1.7.0 _ 05
# Add the following content at the end of vi/etc/profile //
JAVA_HOME =/var/tomcat/jdk1.7.0 _ 05
Export JAVA_HOME
CLASSPATH =/var/tomcat/jdk1.7.0 _ 05/lib:/var/tomcat/jdk1.7.0 _ 05/jre/lib :.
Export CLASSPATH
PATH = $ PATH: $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin
Export PATH
JRE =/var/tomcat/jdk1.7.0 _ 05/jre
Export JRE

Install tomcat
# Cd/var/tomcat/res
# Tar-zvxf apache-tomcat-7.0.29.tar.gz
# Mv apache-tomcat-7.0.29/var/tomcat

Install jsvc
# Cd/var/tomcat/bin // enter the installation directory
# Tar-zvxf commons-daemon-native.tar.gz // unzip
# Cd commons-daemon-1.0.10-native-src/unix // enter the jsvc-src directory
# Autoconf
#./Configure -- with-java =/var/tomcat/jdk1.7.0 _ 05
# Make

Install APR
# Cd/var/tomcat/res
# Tar zxvf apr-1.3.8.tar.gz
# Cd apr-1.3.8
# Chmod a + x configure
#./Configure -- prefix =/var/tomcat/apr
# Make & make install

Install APR-UTIL
# Cd/var/tomcat/res
# Tar zxvf apr-util-1.3.9.tar.gz
# Cd apr-util-1.3.9
#./Configure -- prefix =/var/tomcat/apr-util -- with-apr =/var/tomcat/apr
# Make & make install

Compile and install Native
# Cd/var/tomcat/bin
# Tar zxvf tomcat-native.tar.gz
# Cd tomcat-native-1.1.24-src/jni/native
#. /Configure -- prefix =/var/tomcat/apr -- with-apr =/var/tomcat/apr -- with-java-home =/var/tomcat/jdk1.7.0 _ 05
# Make & make install

Copy the tomcat_xz file to the/etc/init. d directory and rename it tomcat (see the next article)

Change tomcat installation directory permissions
# Chown-R xz_lan: xz_server/var/tomcat
# Chown-R xz_lan: xz_server/var/tomcat /*

Establish a soft connection (start automatically)
# Ln-s/etc/init. d/tomcat/etc/rc. d/rc3.d/K01tomcat
# Ln-s/etc/init. d/tomcat/etc/rc. d/rc3.d/S99tomcat
# Ln-s/etc/init. d/tomcat/etc/rc. d/rc5.d/K01tomcat
# Ln-s/etc/init. d/tomcat/etc/rc. d/rc5.d/S99tomcat

Or set it as a background service.
#/Sbin/chkconfig -- del tomcat
#/Sbin/chkconfig -- add tomcat
#/Sbin/chkconfig -- list tomcat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.