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: