Installation of Tomcat 1. Download Tomcat
Download Tomcat's compression pack apache-tomcat-7.0.54.tar.gz from the Tomcat official website (http://tomcat.apache.org/download-70.cgi). The official website has three parts binary Distributions,deployer,extras, explained as follows:
[Java]View PlainCopyprint?
- Binary Distributions
- Core:
- Zip (PGP, MD5)
- tar.gz (PGP, MD5)
- 32-bit Windows Zip (PGP, MD5)
- 64-bit Windows Zip (PGP, MD5)
- 64-bit Itanium Windows Zip (PGP, MD5)
- 32-bit/64-bit Windows Service Installer (PGP, MD5)
- Full Documentation:
- tar.gz (PGP, MD5)
- Deployer:
- Zip (PGP, MD5)
- tar.gz (PGP, MD5)
- Extras:
- JMX Remote Jar (PGP, MD5)
- WEB Services Jar (PGP, MD5)
- Juli adapters Jar (PGP, MD5)
- Juli log4j Jar (PGP, MD5)
- Embedded:
- tar.gz (PGP, MD5)
- Zip (PGP, MD5)
- Zip for Windows operating systems, tar.gz for UNIX and Linux operating systems.
- Binary distributions Core: This column is for running the installation files directly.
- Deployer: This is a list of files for programmers to program.
- Source code distributions: This column is the Tomcat source.
2. Unzip the installation
2.1 Upload apache-tomcat-7.0.54.tar.gz to the server and move to the/usr/local directory
[Java]View PlainCopyprint?
- sudo mv apache-tomcat-7.0. 54.tar.gz/usr/local/
2.2 Enter/usr/local directory (cd/usr/local/) decompression
[Java]View PlainCopyprint?
- sudo tar-zxvf apache-tomcat-7.0. 54.tar.gz
2.3 Renaming apache-tomcat-7.0.54 to Tomcat
[Java]View PlainCopyprint?
- MV apache-tomcat-7.0. Si Tomcat
2.4 Delete apache-tomcat-7.0.54.tar.gz
3. Modify the Tomcat port
Enter the cd/usr/local/apache-tomcat-7.0.42/conf/directory and open server.xml (sudo vim server.xml) to change port 8080 to 8081.
[Java]View PlainCopyprint?
- <connector port="8081" protocol="http/1.1 "
- connectiontimeout="20000"
- redirectport="8443"/>
4. Verification
Switch to root user under Sudo–i, start Tomcat (/usr/local/apache-tomcat-7.0.42/bin/startup.sh), enter http://localhost:8081/in the browser See the Tomcat Welcome page. LocalHost is replaced with the Linux server IP.
5. Tomcat Memory optimization
Tomcat memory optimization is primarily optimized for Tomcat boot parameters individuals can be set according to their actual situation.
[Java]View PlainCopyprint?
- java_opts='-xms2048m-xmx4096m-xmn1g-xss1024k-xx:newratio=4-xx:survivorratio=4-xx:permsize=1024m-xx: MAXPERMSIZE=1024M-XX:MAXTENURINGTHRESHOLD=0-XX:+USEPARALLELGC-XX:PARALLELGCTHREADS=20-XX:+USEPARALLELOLDGC-XX: +useadaptivesizepolicy '
The entire installation configuration is complete, and the next section is about booting from the Linux tomcat.
Linux SSH Installation Tomcat