Debian Tomcat6.0 startup settings

Source: Internet
Author: User
Debian Tomcat6.0 boot startup settings-Linux Release Technology-Debian information, the following is a detailed description. According to the Document description on the apache website (this description is also poorly written !), Jsvc is required if tomcat runs as a daemon. (What is this tool? I don't understand it. I'm too lazy to study it. It's best to bring it into tomcat)

1. Preparations
After Tomcat is installed, if Tomcat is enabled as the root user, Tomcat will have the root permission, which may pose a security risk to the system. hackers may exploit this permission to attack our system, therefore, we need to add a user who runs the service independently and use the following command:

Shell> useradd-d/usr/local/tomcat6-s/usr/sbin/nologin tomcat

The preceding command adds a tomcat user to the system and sets it to nologin.

Set tomcat 5's tomcat Permissions
Shell> chown-R tomcat: tomcat/usr/local/tomcat6
Shell> chown-R tomcat: tomcat/opt/apache-tomcat-6.0.13

2. Install jsvc
Shell> cd/usr/local/tomcat6/bin
Shell> tar xvfz jsvc.tar.gz
Shell> cd jsvc-src
Shell> sh support/buildconf. sh

If it succeeds, the command terminal prints the following report:
Support/buildconf. sh: configure script generated successfully

[Note: Previously, autoconf was installed in my system. You can use shell> sudo apt-get install autoconf to install it]

Add execution permission for configure
Shell> chmod 755 configure
Shell>./configure? With-java =/usr/lib/j2sdk1.6-sun (this is the JDK installation location of our system)
Shell> make

Okay! If no error occurs, jsvc is successfully installed!

3. Set the Startup Script
Next, copy a tomcat5.sh template in jsvc to the/etc/init. d directory, and modify it according to your own situation.

Shell> cp/usr/local/tomcat6/bin/jsvc-src/native/Tomcat5.sh/etc/init. d/tomcat

The above command is to move the tomcat5.sh file to/etc/init. d/and rename it tomcat

Modify the/etc/init. d/tomcat file:
Shell> vi/etc/init. d/tomcat

The following figure shows how to modify the tomcat file:
QUOTE:

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.