Deploy and optimize Tomcat under Centos

On the basis of the above articles, this article will mainly teach novices how to deploy and optimize tomcat on Centos system

# wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.79/bin/apache-tomcat-7.0.79.tar.gz

Unzip apache-tomcat-7.0.79.tar.gz

# tar -xvf apache-tomcat-7.0.79.tar.gz

Analogous to tomcat startup on Windows, start tomcat through the startup.sh script in the bin directory

# cd apache-tomcat-7.0.79/bin
# . /startup.sh && tail -f ../logs/catalina.out

You can see the usual log printing from the window. After a while, tomcat can be started. Open the server's ip:8080 with a browser to see the cat's logo.

# vim $JAVA_HOME/jre/lib/security/java.security

or

# vim $JRE_HOME/lib/security/java.security

Find securerandom.source=file:/dev/random and change to

securerandom.source=file:/dev/urandom

: wq save and exit

Tomcat Connector supports three modes of operation: BIO, NIO, APR.

One thread processes one request. Disadvantages: When the amount of concurrency is high, there are more threads, which wastes resources.

Tomcat7 or below, this method is used by default in Linux systems.

Using Java's asynchronous IO processing, a large number of requests can be processed through a small number of threads.

Tomcat8 uses this method by default in Linux systems.

Tomcat7 must modify the Connector configuration to start:

That is, Apache Portable Runtime, which solves the io blocking problem from the operating system level.

Tomcat7 or Tomcat8 starts this way by default in Win7 or above systems.

If Linux is installed with apr and native, Tomcat will support apr when started directly

In the traditional sense, Tomcat under Linux requires a lot of compilation work to enable APR mode, and the knowledge points involved in the middle are too extensive, so the following directly uses the compiled library in the centos source to enable Tomcat to enable APR mode

# yum install tcnative

Restart tomcat and see "Starting ProtocolHandler ["http-apr-8080"]" displayed on the console, which means the optimization is successful!

Recommended Posts

Deploy and optimize Tomcat under Centos
Tomcat installation and configuration under CentOS 7 (Tomcat startup)
Deploy GitBook under CentOS7
Deploy JDK+Tomcat8 under CentOS
CentOS6.5 install Java 8 and Tomcat8
CentOS6.5 install Java 8 and Tomcat8
CentOS6.5 install Java 8 and Tomcat8
Environment configuration of JDK, mysql and tomcat under Centos7
Install and configure keepalived under CentOS 5.9
Compile and install LAMP under Centos 5.2
Use Nginx and u under CentOS
Upgrade OpenSSL and OpenSSH under CentOS7
Install and deploy Gerrit under Ubuntu
Java-JDK installation and configuration under CentOS
Install Python3 and ansible under CentOS8
Install and use docker under CentOS 6.8
CentOS 7 Tomcat service installation and configuration
Install Python3 and Py under CentOS7
Erlang 20.2 installation and deployment under CentOS 7
Use Jexus 5.8.2 to deploy and run Asp.net core under Centos
virtualBox install centos, and build tomcat
Install Mono 3.2 and Jexus 5.4 under CentOS 6.3
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
Installation and configuration of redis under centos7
Zabbix installation and deployment and localization under CentOS
Deploy Docker and configure Nginx in CentOS
Jenkins installation and deployment tutorial under CentOS 7
Install Mono 2.10.8 and Jexus 5.0 under 32- and 64-bit CentOS 6.0
KVM installation and preliminary use under CentOS 7.2
Centos7.6 deploy django+nginx+uwsgi
CentOS 7 deploy OpenLDAP+FreeRadius
CentOS 7 installation and configuration graphic tutorials under VMware10
Install svn and configuration through yum under CentOS
Installation and configuration of rsync server under CentOS 6.5
MySQL 8.0 installation and deployment under CentOS, super detailed!
Installing CentOS 6 and SSH configuration under Windows 8 Hyper-V
How to install and uninstall tomcat on centos
Kickstart+PXE automatically deploy CentOS6.6
Install centos7 and connect
Installation and cracking of confluence6.3 operation records under Centos
Vmware-install and start Centos 8
Compile Hadoop-2.7.6 under CentOS7.4
Install mysql5.7 under CentOS7
Vmware-install and start Centos 7
Install ActiveMQ under Centos7
Installation and cracking of Jira7 operation records under Centos
Install PostgreSQL12 under CentOS7
Install CentOS under VMware
[python] python2 and python3 under ubuntu
CentOS 6.8 deploy zookeeper cluster
CentOS 7 deploy saltstack service
CentOS7 install JDK8, tomcat8
Install mysql under Centos 7
Configure lamp under centos6.8
Install Jenkins under Centos 7
Deploy vuepress on centos7
Redis3 installation under Centos7
Deploy Graylog open source log management system under CentOS7
Centos6.8 deploy vnc service
Install MariaDB under MariaDB Centos7
Install mysql5.1 under CentOS6.5