Lucky 28 Platform Rental vs. Linux non-root

Source: Internet
Author: User

1. Install JDK and Tomcat installation directory for/usr/local/apache-tomcat-8.0.52 steps

2. Create a user tomcat and set it to not be logged on
Its command #useradd-s/usr/sbin/nologin Tomcat
3. Install and compile the daemon service
3.1 Switching directories into the Tomcatbin directory #cd/usr/local/apache-tomcat-8.0.52/bin/
3.2 Extract the daemon file #tar-xzvf commons-daemon-native.tar.gz
3.3 Enter the installation path #cd commons-daemon-1.0.15-native-src/unix/
3.4 Installation #./configure
3.5 Compiling # Make
3.6 Copying compiled files
When you do make, a jsvc file is generated and copied to the Tomcat bin directory CP Jsvc/usr/local/apache-tomcat-8.0.52/bin
4. Modify the startup script
Command #vi/usr/local/apache-tomcat-8.0.52/daemon.sh
Find the following:
Test ". $TOMCAT _user" =. && Tomcat_user=tomcat

Set Java_home to working JDK or jrejava_home=/opt/jdk-1.6.0.22

Modify Tomcat_user=tomcat, "Tomcat" is the user who is running Tomcat, the user created by this article is Tomcat, so there is no need to modify it.
Remove the comment (that is, "#") before Java_home and set it to the directory where the JDK is located (/opt/jdk_1.7).

5. Change the Tomcat directory permissions
5.1 Giving users the right to execute
chmod a+x/opt/tomcat8/bin/daemon.sh
5.2 Modifying the user owner of logs temp work conf
Chown Tomcat Logs
Chown Tomcat Temp
Chown Tomcat Work
Chown Tomcat conf
Modify the user owner of the file inside the Conf
Chown Tomcat conf/*

6. Speed up Tomcat boot
Open the $java_path/jre/lib/security/java.security file and find the following:
Securerandom.source=file:/dev/urandom (or Securerandom.source=file:/dev/random) replaced with securerandom.source=file:/dev/ ./urandom

Lucky 28 Platform Rental vs. Linux non-root

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.