Download presentation
Presentation is loading. Please wait.
Published byTyrone Harrington Modified over 9 years ago
1
The Power of mod_proxy Proxy servers, load balancers and how to implement with Apache HTTP Server.
2
Hello World Paul Weinstein Web Programmer/Analyst at Orbit Media Studios, Inc.
3
Proxy Servers
4
What is a Proxy Server? When Might a Proxy Server Be Useful? How to Implement a Proxy Server with Apache HTTP Server?
5
What is a Proxy Server? “A server that acts as an intermediary for requests from clients seeking resources from other servers.” 1 1 From Wikipedia, http://en.wikipedia.org/wiki/Proxy_serverhttp://en.wikipedia.org/wiki/Proxy_server
6
When Might a Proxy Server Be Useful? “To provide Internet access to internal clients that are otherwise restricted by a firewall.” “The proxy can also use caching to reduce network usage.” 2 2 Apache Module mod_proxy Documentation, http://httpd.apache.org/docs/2.1/mod/mod_proxy.html
7
When Might a Proxy Server Be Useful?
8
“To provide Internet users access to a server that is behind a firewall.” “Provide caching for a slower back-end server.” “Be used simply to bring several servers into the same URL space” “Be used to balance load among several back-end servers.” 2 2, Apache Module mod_proxy Documentation, http://httpd.apache.org/docs/2.1/mod/mod_proxy.html
9
When Might a Proxy Server Be Useful?
10
Implementing a Proxy Server with HTTP Server In Association with: mod_cache mod_ssl Standard Apache Distribution: mod_proxy mod_proxy_http mod_proxy_ftp mod_proxy_ajp mod_proxy_connect Third Party: mod_proxy_html * * Move to standard distribution as part of v2.4.0, http://bahumbug.wordpress.com/2011/10/28/modules-move-home/http://bahumbug.wordpress.com/2011/10/28/modules-move-home/
11
Implementing a Forward Proxy Server with HTTP Server ProxyRequests On ProxyVia On
12
Implementing a Proxy Server with HTTP Server Order Deny,Allow Deny from all Allow from 192.168.0
13
Implementing a Reverse Proxy Server with HTTP Server ProxyRequests Off ProxyPass /back http://backend.example.comhttp://backend.example.com ProxyPassReverse /back http://backend.example.comhttp://backend.example.com ProxyHTMLURLMap http://backend.example.com /backhttp://backend.example.com
14
Load Balancers
15
What is a Load Balancer? When Might a Load Balancing be Useful? How to Implement a Load Balancer with Apache HTTP Server
16
What is a Load Balancer? “A networking methodology to distribute workload across multiple resources.” 3networking 3 From Wikipedia, http://en.wikipedia.org/wiki/Load_balancing_(computing)http://en.wikipedia.org/wiki/Load_balancing_(computing)
17
When Might Load Balancing be Useful?
18
Implementing a Proxy Server with HTTP Server In Association with: mod_cache mod_ssl Standard Apache Distribution: mod_proxy mod_proxy_http mod_proxy_ftp mod_proxy_ajp mod_proxy_connect mod_proxy_balancer Third Party: mod_proxy_html * * Move to standard distribution as part of v2.4.0, http://bahumbug.wordpress.com/2011/10/28/modules-move-home/http://bahumbug.wordpress.com/2011/10/28/modules-move-home/
19
Implementing a Failover Load Balancer with HTTP Server ProxyRequests Off ProxyPass /webapp balancer://cluster ProxyPassReverse /webapp http://prime.example.com:80http://prime.example.com:80 ProxyPassReverse /webapp http://fail.example.com:80http://fail.example.com:80 ProxyHTMLURLMap http://prime.example.com:80 /webapphttp://prime.example.com:80 ProxyHTMLURLMap http://fail.example.com:80 /webapphttp://fail.example.com:80 BalancerMember http://prime.example.com:80http://prime.example.com:80 BalancerMember http://fail.example.com:80 status=+Hhttp://fail.example.com:80
20
When Might Load Balancing be Useful? “Distribute workload across multiple computers or a computer cluster... to achieve optimal resource utilization, maximize throughput, minimize response time, and avoid overload.” 3computer cluster 3 From Wikipedia, http://en.wikipedia.org/wiki/Load_balancing_(computing)http://en.wikipedia.org/wiki/Load_balancing_(computing)
21
When Might Load Balancing be Useful?
22
Implementing a Load Balancer with HTTP Server ProxyRequests Off ProxyPass /webapp balancer://cluster \ stickysession=SESSIONID nofailover=On
23
Implementing a Load Balancer with HTTP Server ProxyPassReverse /webapp http://app1.example.com:80http://app1.example.com:80 ProxyPassReverse /webapp http://app2.example.com:80http://app2.example.com:80 ProxyPassReverse /webapp http://app3.example.com:80http://app3.example.com:80 ProxyHTMLURLMap http://app1.example.com:80 /webapphttp://app1.example.com:80 ProxyHTMLURLMap http://app2.example.com:80 /webapphttp://app2.example.com:80 ProxyHTMLURLMap http://app3.example.com:80 /webapphttp://app3.example.com:80 ProxyPassReverseCookiePath /webapp/ /webapp RequestHeader unset Accept-Encoding
24
Implementing a Load Balancer with HTTP Server BalancerMember http://app1.example.com:80 loadfactor=50 route=app1http://app1.example.com:80 BalancerMember http://app2.example.com:80 loadfactor=25 route=app2http://app2.example.com:80 BalancerMember http://app3.example.com:80 loadfactor=25 route=app3http://app3.example.com:80
25
Implementing a Load Balancer with HTTP Server ProxyRequests Off ProxyPass /webapp balancer://cluster stickysession=JSESSIONID nofailover=On ProxyPassReverse /webapp http://app1.example.com:80http://app1.example.com:80 ProxyPassReverse /webapp http://app2.example.com:80http://app2.example.com:80 ProxyPassReverse /webapp http://app3.example.com:80http://app3.example.com:80 ProxyHTMLURLMap http://app1.example.com:80 /webapphttp://app1.example.com:80 ProxyHTMLURLMap http://app2.example.com:80 /webapphttp://app2.example.com:80 ProxyHTMLURLMap http://app3.example.com:80 /webapphttp://app3.example.com:80 ProxyPassReverseCookiePath /webapp/ /webapp RequestHeader unset Accept-Encoding BalancerMember http://app1.example.com:80 loadfactor=50 route=app1http://app1.example.com:80 BalancerMember http://app2.example.com:80 loadfactor=25 route=app2http://app2.example.com:80 BalancerMember http://app3.example.com:80 loadfactor=25 route=app3http://app3.example.com:80
26
Resources/Questions http://httpd.apache.org/docs/2.2/mod/mod_proxy.html http://www.apachetutor.org/admin/reverseproxies http://apache.webthing.com/mod_proxy_html/ http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.ht ml http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.ht ml http://pdw.weinstein.org @pdweinstein
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.