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
- 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
- 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
- Vim/etc/sysconfig/iptables
2. Find the following line:
Java code
- -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
- -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
- Service Iptables Restart
Four, start/close Tomcat
1. Directory for Tomcat
Java code
- Cd/home/java/tomcat7/bin
2. Start Tomcat
Java code
- ./startup.sh
Or start with the full path without needing to enter the directory:
Java code
- /home/java/tomcat7/bin/startup.sh
3. Close Tomcat
Java code
- ./shutdown/sh
Or close directly through the full path:
Java code
- /home/java/tomcat7/bin/shutdown.sh
V. Modifying the Tomcat Port
1. Open Tomcat's server.xml configuration file
Java code
- Vi/home/java/tomcat7/conf/server.xml
2, then directly on the keyboard press/8080 Quick Search
Java code
- /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
- 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
- Vi/etc/rc.d/rc.local
2. Add the following configuration to the file (no need to touch in front):
Java code
- /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
- 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
- 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