linux corporate real --HAProxy implementation of static and dynamic separation

1. The dynamic, static requests

See URL distinction, html is static.

  • Dynamic pages are ASP, PHP, JSP, http: //ASP.net,Perl, or programming languages such as CGI production.
    Also known as dynamic link dynamic pages, written in English is: Dynamic URL.
  • Dynamic content on the page exists in the database, according to different requests issued by the user, which provides personalized web content; dynamic page content is not present on the page, but in the database, thereby greatly reducing the workload of site maintenance; using dynamic web site technology can achieve more functionality, such as user registration, user login, online surveys, user management, order management, and so on; static pages can not achieve these functions.

2.haproxy implement client access dynamic static separation

Step one: edit the configuration file /etc/haproxy/haproxy.cfg

Here Insert Picture Description

Server1 in the profile to achieve their own polling, so serevr1 upload service httpd
Here Insert Picture Description

Step two: Change httpd port, and restart the httpd service

Because the port serevr1 80 has been occupied
Here Insert Picture Description
Here Insert Picture Description

Step Three: In server3 in / var / www / html / images / directory decentralization picture
Here Insert Picture Description

Step five: Restart server1 in haproxy Service
Here Insert Picture Description
Step Six: Testing

Test 1: The dynamic access and for polling
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture DescriptionWhen accessing static
Here Insert Picture Description

At this point, there is no resource on the proxy server. On the resource in the specified real server

When a Dynamic Host access into standby mode: Test Two
Here Insert Picture Description
At this time, no polling. When the primary server service normally visit only the main server. When the primary server dawdle off, standby server only provide services i.
Here Insert Picture Description
Here Insert Picture Description

Published 135 original articles · won praise 1 · views 1626

Guess you like

Origin blog.csdn.net/qq_45652989/article/details/104772834