Advertisement
umefarooq

mod_proxy settings with master server request for replicate

Feb 11th, 2014
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <VirtualHost *:80>
  2.         ProxyRequests off
  3.        
  4.         ServerName domain.com
  5.  
  6.         <Proxy balancer://writecluster>
  7.                 # WebHead1 or master server
  8.                 BalancerMember http://10.176.42.144:80
  9.                 # WebHead2
  10.                 BalancerMember http://10.176.42.148:80
  11.  
  12.                 # Security "technically we aren't blocking
  13.                 # anyone but this the place to make those
  14.                 # chages
  15.                 Order Deny,Allow
  16.                 Deny from none
  17.                 Allow from all
  18.  
  19.                 # Load Balancer Settings
  20.                 # We will be configuring a simple Round
  21.                 # Robin style load balancer.  This means
  22.                 # that all webheads take an equal share of
  23.                 # of the load.
  24.                 ProxySet lbmethod=byrequests
  25.  
  26.         </Proxy>
  27.  
  28.         # balancer-manager
  29.         # This tool is built into the mod_proxy_balancer
  30.         # module and will allow you to do some simple
  31.         # modifications to the balanced group via a gui
  32.         # web interface.
  33.         <Location /balancer-manager>
  34.                 SetHandler balancer-manager
  35.  
  36.                 # I recommend locking this one down to your
  37.                 # your office
  38.                 Order deny,allow
  39.                 Allow from all
  40.         </Location>
  41.  
  42.         # Point of Balance
  43.         # This setting will allow to explicitly name the
  44.         # the location in the site that we want to be
  45.         # balanced, in this example we will balance "/"
  46.         # or everything in the site.
  47.         ProxyPass /balancer-manager !
  48.         ProxyPass / balancer://writecluster/
  49.  
  50.     # Enable mod_rewrite
  51.     RewriteEngine On
  52.     # Send POST, PUT, and DELETEs to "write" balancer
  53.  
  54.     RewriteCond %{REQUEST_METHOD} ^(POST|PUT|DELETE)$
  55.     RewriteRule ^/(.*)$http://10.176.42.144:80/$1 [P,QSA,L]
  56.  
  57.        
  58.     # Modify HTTP response headers (e.g. Location)
  59.     ProxyPassReverse / balancer://writecluster
  60.  
  61.  
  62. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement