: This article mainly introduces static/dynamic separation-Nginx + Tomcat. For more information about PHP tutorials, see. Static and dynamic content in Web applications are separately placed on different Web servers to process dynamic and static content in a targeted manner to improve performance.
Because Tomcat is weak in concurrent and static resource processing capabilities. Static and dynamic separation is one of the methods. since Tomcat is weak in processing static resources, it will hand over the processing tasks of static resources to appropriate software, so that Tomcat can focus on processing JSP/Servlet requests. For static resource processing server software, we chose Nginx. It supports high concurrency and is highly capable of processing static resources.
In fact, there are many static/dynamic separation solutions. some people use the combination of Apache + Tomcat, while others use the combination of Tomcat + Tomcat. However, two Tomcat servers are placed on different hosts and different domain names respectively. The Apache + Tomcat solution is the same as the Nginx solution in principle. they are based on reverse proxy. compared with the dynamic/static separation using Nginx configuration, Apache configuration is slightly more complex.
Prerequisites: you have a primary domain name server in the Tomcat + JDK environment.
Set subdomain name
The IP host pointed to by the subdomain name stores static resources.
Configure resolution for HiChina second-level domain names
Install Nginx
-
Environment required for nginx installation, pcre (for rewrite), zlib (for compression), ssl
yum -y install zlibyum –y install pcreyum –y install openssl
-
Download and install nginx-* .tar.gz
Download nginx-1. * .tar.gz
Tar-zxvf nginx-1.2.8.tar.gz-C ./
Cd nginx-1.2.8
./Congigure-prefix =/usr/local/nginx
Make & make install
To be continued
Reference URL
Dynamic/static separation and load balancing using Nginx
CentOS + Nginx step by step to configure server load balancer
Nginx Reverse proxy and server load balancer Deployment Guide
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above introduces the dynamic and static separation-Nginx + Tomcat, including the content, hope to be helpful to friends who are interested in PHP tutorials.