Static and dynamic separation-nginx+tomcat

Source: Internet
Author: User
Tags install openssl domain name server nginx reverse proxy
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

    1. Install Nginx required environment, pcre (function rewrite), zlib (function compression), SSL

      yum -y install zlibyum –y install pcreyum –y install openssl  
    2. 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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.