The so-called dynamic separation is to put the static and dynamic content of the Web application on different Web servers, and to deal with dynamically and static content, so as to achieve the performance improvement.
Because Tomcat is less capable of concurrency and static resource processing. Static and dynamic separation is one of the methods, since the ability of Tomcat to deal with statically-resourced resources is weak, so that the processing of static resources to the appropriate software, and let Tomcat focus on processing Jsp/servlet requests. For the static resource processing server software, we chose Nginx. It supports high concurrency and has a strong ability to handle static resources.
In fact, static and dynamic separation of the scheme are many, some people use apache+tomcat combination, but also someone using a combination of tomcat+tomcat, but two Tomcat is placed on different hosts, different domain names. The APACHE+TOMCAT scheme is the same as the Nginx scheme principle, they are based on reverse proxy, compared to the use of Nginx configuration static and dynamic separation, Apache configuration is slightly more complex.
Prerequisite: There is a primary domain name server in the TOMCAT+JDK environment
Set sub-domain name
The IP host that the subdomain points to holds static resources
Analysis of two level domain name setting in WAN network
Installing Nginx
Install Nginx required environment, pcre (function rewrite), zlib (function 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
Not to be continued
Reference URL
Using Nginx to realize static and dynamic separation and load balancing
Centos+nginx Start configuring Load Balancing Step-by-step
Nginx reverse proxy and 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); }); });
The above describes the static and dynamic separation-nginx+tomcat, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.