Editing
LoadBalancer External Sites: Apache mod balancer
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Load Balanced WEBSITE - example= * IP: 10.0.0.111 == Apache Config == * '''Location''': /etc/httpd/conf.d/balancer/10.0.0.111.conf * '''Customer Files''': I.E. htpasswd, customer certs & keys, etc.. :::: /etc/httpd/conf.d/balancer/10.0.0.111/ * '''Verify''' the servername ''IS UNIQUE'' - This matters mainly for SSL. :If you use a servername already in use, apache will use the FIRST ssl cert <source lang=text> ## IN USE <VirtualHost 10.0.0.111:80> ServerName mb-vip8.domain.tld # don't loose time with IP address lookups HostnameLookups Off UseCanonicalName Off Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED ProxyPreserveHost On ProxyRequests off <Proxy balancer://robreed> BalancerMember http://8.8.8.8:80 route=1 BalancerMember http://4.4.4.2:80 route=2 # the hot standby if all fail? # BalancerMember http://10.0.0.5:80 status=+H Order Deny,Allow Deny from none Allow from all ProxySet lbmethod=bybusyness stickysession=ROUTEID </Proxy> <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 10.0.0 </Location> <Location /balancer-manager> SetHandler balancer-manager Deny from all AuthUserFile /etc/httpd/conf.d/balancer/10.0.0.111/htpasswd AuthName authorization AuthType Basic Allow from 10.0.0 Satisfy Any require valid-user </Location> ProxyPass /balancer-manager ! ProxyPass /server-status ! ProxyPass / balancer://robreed/ </VirtualHost> <VirtualHost 10.0.0.111:443> ServerName mb-vip8.domain.tld # don't loose time with IP address lookups HostnameLookups Off UseCanonicalName Off Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED ProxyPreserveHost On ProxyRequests off <Proxy balancer://robreed> BalancerMember https://8.8.8.8:443 route=1 # BalancerMember https://4.4.4.2:443 route=2 # the hot standby if all fail? # BalancerMember https://10.0.0.5:443 status=+H Order Deny,Allow Deny from none Allow from all ProxySet lbmethod=bybusyness stickysession=ROUTEID </Proxy> <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 10.0.0 </Location> <Location /balancer-manager> SetHandler balancer-manager Deny from all AuthUserFile /etc/httpd/conf.d/balancer/10.0.0.111/htpasswd AuthName authorization AuthType Basic Satisfy Any require valid-user </Location> ProxyPass /balancer-manager ! ProxyPass /server-status ! ProxyPass / balancer://robreed/ SSLEngine on SSLProxyEngine On SSLProtocol all -SSLv2 SSLHonorCipherOrder On SSLCipherSuite ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH SSLCertificateFile /etc/httpd/conf/ssl.crt/selfsigned.crt SSLCertificateKeyFile /etc/httpd/conf/ssl.key/selfsigned.key </VirtualHost> </source> == Client Logging - X-Forwarded-For == * logs will probably be turned off locally * clients can use X-Forwarded-For header ; example Apache config to log remote IP <source lang=text> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy CustomLog /etc/httpd/logs/rarforge-access_log_proxy proxy </source> == Balancer Manager - Client Interface == * clients can loging to http://<their balanced IP>/balancer-manager/ to perform basic tasks * '''an apache restart will revert any changes''' this might cause odd issues... need to let customer know. === HowTo === * Click on worker URL to edit values (''' not persistent on apache reload''') <source lang=text> loadfactor 1 Worker load factor. Used with BalancerMember. It is a number between 1 and 100 and defines the normalized weighted load applied to the worker. lbset 0 Sets the load balancer cluster set that the worker is a member of. The load balancer will try all members of a lower numbered lbset before trying higher numbered ones. route - Route of the worker when used inside load balancer. The route is a value appended to session id. redirect - Redirection Route of the worker. This value is usually set dynamically to enable safe removal of the node from the cluster. If set all requests without session id will be redirected to the BalancerMember that has route parameter equal as this value. </source> <source lang=text> Status Options: Dis: is disabled (removes the server from the active list) Ign: is ignore-errors ( monitoring is stopped?) Stby: is hot-standby ( only used when ALL servers are out of LB) # This can also be set int LB config for persistence if needed # Status can be set (which is the default) by prepending with '+' or cleared by prepending with '-'. # Thus, a setting of 'S-E' sets this worker to Stopped and clears the in-error flag. status=+[E|S|D|I|H|S] 'D' is disabled, 'I' is ignore-errors, 'H' is hot-standby 'E' is in an error state. 'S' is stopped, </source>
Summary:
Please note that all contributions to RARForge may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
RARForge:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home
All Pages
All Files
View Categories
Recent changes
Random page
Edit this menu
Tools
What links here
Related changes
Special pages
Page information