Linux tomcat installation, Linux configuration Tomcat,linux tomcat modify memory, Linux tomcat modify port

Source: Internet
Author: User

Linux tomcat installation, Linux configuration Tomcat,linux tomcat modify memory, Linux tomcat modify port

>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>

? Copyright Sweet Potato Yiu March 1, 2017

http://www.cnblogs.com/fanshuyao/

JDK installation See:http://fanshuyao.iteye.com/blog/2302562

First, the installation of Tomcat is very simple, just need to extract apache-tomcat-7.0.69.tar.gz files.

Java code
    1. TAR-ZXVF apache-tomcat-7.0.69.tar.gz

Second, then move the extracted Tomcat folder under the Java folder and rename it to TOMCAT7, so it's easy to remember

Java code
    1. MV APACHE-TOMCAT-7.0.69/USR/JAVA/TOMCAT7

Third, modify the Linux port access restrictions, you need to add 80 (or 8080) port access, or not access.

1. Open iptables File

Java code
    1. Vim/etc/sysconfig/iptables

2. Find the following line:

Java code
    1. -A input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT

3, directly copy this line to the next line, and then put

-A input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT

22 Change to 8080 port

As shown in the following:

4, if as a formal server, you need to change the 8080 port to 80 port:

Java code
    1. -A input-m state--state new-m tcp-p TCP--dport 80-j ACCEPT

5, need to note is: Also need to change the tomcat port to 80 port, tomcat default port is 8080

6. Then restart the service

Java code
    1. Service Iptables Restart

Four, start/close Tomcat

1. Directory for Tomcat

Java code
    1. Cd/home/java/tomcat7/bin

2. Start Tomcat

Java code
    1. ./startup.sh

Or start with the full path without needing to enter the directory:

Java code
    1. /home/java/tomcat7/bin/startup.sh



3. Close Tomcat

Java code
    1. ./shutdown/sh

Or close directly through the full path:

Java code
    1. /home/java/tomcat7/bin/shutdown.sh



V. Modifying the Tomcat Port

1. Open Tomcat's server.xml configuration file

Java code
    1. Vi/home/java/tomcat7/conf/server.xml

2, then directly on the keyboard press/8080 Quick Search

Java code
    1. /8080

3, modify the port, press I to enter the editing mode, the 8080 changes to 80 port.

4. Press ESC to exit edit mode, and then press: Wq Save and exit

5. Restart Tomcat, the browser opens the access address

Vi. modifying Tomcat's memory

1. Found in the catalina.sh file in Tomcat's Bin directory

# OS specific support. $var _must_ is set to either true or false.

This sentence, and then add the following configuration below:

Java code
    1. Java_opts= "-xms1024m-xmx4096m-xss1024k-xx:permsize=512m-xx:maxpermsize=2048m"

2. Save changes, restart Tomcat

3, can refer to: http://www.cnblogs.com/sixiweb/archive/2012/11/25/2787591.html

Seven, set up tomcat boot

1. Edit the Rc.loca file:

Java code
    1. Vi/etc/rc.d/rc.local

2. Add the following configuration to the file (no need to touch in front):

Java code
    1. /home/java/tomcat7/bin/startup.sh

As shown in the following:



3, save exit, restart Linux server authentication.

4, Linux restart the server:

On the command line, enter: Shutdown-r now: means restart the computer!

Another way to restart is to enter: Reboot also means reboot!



View the tomcat process from the command post:

Ps-ef|grep Java

or access the Tomcat service through a browser

Eight, tomcat operations commonly used commands

1. View the Tomcat process

Java code
    1. Ps-ef|grep Java or Ps-ef|grep tomcat

Where 10740 is the process number.

2. Kill the Tomcat process

Kill-9 10740

Where 10740 is the Tomcat process number (PID) found above

3. View the Tomcat log

Go to the logs directory under Tomcat and execute the following command:

Tail-f Catalina.out

You can view the log information dynamically



Exit View log using: Ctrl + Z

4. Use Netstat-tln to view port information Sometimes we start a Tomcat visit, and then we can use it to see if there's a 8080 port.



Locate the specified run Port command:

Java code
    1. Netstat-an | grep ': 8080 '

>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>

? Copyright Sweet Potato Yiu March 1, 2017

http://www.cnblogs.com/fanshuyao/

Linux tomcat installation, Linux configuration Tomcat,linux tomcat modify memory, Linux tomcat modify port

Related Article

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.