Googolflex!!
  • Home
  • About
  • Contracting

Recent Posts

  • Sprint’s new “Simply ‘Almost’ Everything®” Plans
  • CSS Changes in Flex 4
  • Dotted Underline LinkButton (Flex)

About The Author : jwd

This is John Dusbabek's tech blog. John is a software engineer and Flex developer in Provo, UT, where he lives with his lovely wife and four sons.

Recent Comments

  • nodmonkey on PHP Warning: mysql_connect(): Can’t connect to MySQL server on… (13)
  • Can't connect to mysql with php/apache but can with cli | That-Matt on PHP Warning: mysql_connect(): Can’t connect to MySQL server on… (13)
Feb
02

Apache mod_proxy_balancer: No Protocol handler was valid

By jwd

Just this afternoon, one of my colleagues and I were discussing our feelings about the “semicolon-class” of bugs that developers will inevitably spin their wheels on from time to time. I’ve had just such an experience the past two evenings with what started out as a simple recipe from the Apache Cookbook, entitled “Load Balancing with mod_proxy_balancer”.

The recipe itself is straightforward, taking up just over a page. I was able to get a basic load balancer working within a few minutes by following the recipe, but for some reason I couldn’t get the balancer-manager site to load correctly. The following directives should configure the balancer-manager:

<Location /balancer-manager>
  SetHandler balancer-manager
  Order Deny,Allow
  Allow from all
</Location>

When I would start the server, however, I got an HTTP 500 error response, with this message in the log:

[Tue Feb 02 12:49:09 2010] [warn] proxy: No protocol handler was valid for the URL /balancer-manager. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

My searches on Google were fruitless: most people were able to solve the problem by ensuring these lines were added to their httpd.conf:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

But they were already included in my conf file, so no dice. Other people solved their problem by loading the mod_proxy_html.so, which doesn’t come on a standard install of Apache. I ended up compiling it from source (learned a lot about compiling Apache shared modules) but that didn’t work for me either.

Eventually I realized that the only time my requests were being proxied to the BalancerMembers was when I was at the URL root, for example tacking on an ‘index.php’ to the URL would generate the same error as trying to access ‘balancer-manager’. And about that time I stumbled upon a user who was able to solve their problem by adding a few rewrite rules… which caused me to finally understand part of my problem.

The reason ‘balancer-manager’ wasn’t loading correctly was because that request was being proxied to the BalancerMember, which didn’t have ‘balancer-manager’ enabled (hence the ‘no protocol handler error’). This still didn’t explain why ‘index.php’ wasn’t working, either, since I knew index.php was on the BalancerMembers.

These discoveries quickly culminated into leading me to my solution, which was a missing trailing-slash in my ProxyPass directive. That’s what was causing my ‘index.php’ to not be proxied. Once I realized the problem was in my ProxyPass– reading the documentation also taught me that there’s a way to keep certain requests from being proxied (which solved my ‘balancer-manager’ issue).

So I present to you, my completed (and functional) balancer.conf. And remember, the trailing slash at the end of the ProxyPass directive IS CRUCIAL!

ProxyPass /balancer-manager !  # Prevents balancer-manager from being proxied.
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/

<Proxy balancer://mycluster>
  BalancerMember http://10.0.0.10 loadfactor=2
  BalancerMember http://10.0.0.11
  BalancerMember http://10.0.0.12
</Proxy>

<Location /balancer-manager>
  SetHandler balancer-manager
  Order Allow,Deny
  Allow from all
</Location>

I hope this saves someone some time when searching on the particular error message I got. Now I’m off to figure out how to get my web servers to auto register with the balancer-manager. I will blog about it when I figure it out.

Categories : Apache Web Server, Architecture, HTTP Servers, Scalability, client/server

Leave a Comment

CAPTCHA Image Audio Version
Reload Image

Search

Feedburner

Subscribe to

Get the latest updates delivered via email

Calendar

July 2010
M T W T F S S
« Jun    
 1234
567891011
12131415161718
19202122232425
262728293031  

Archives

  • July 2010 (1)
  • June 2010 (2)
  • May 2010 (1)
  • February 2010 (11)
  • January 2010 (3)
  • December 2009 (5)
  • November 2009 (1)
  • August 2009 (8)
  • July 2009 (8)
  • May 2009 (4)
  • April 2009 (1)
  • March 2009 (6)
  • January 2009 (1)
  • November 2008 (4)
  • October 2008 (5)
  • September 2008 (1)
  • August 2008 (5)
  • July 2008 (1)
  • June 2008 (2)
  • May 2008 (8)
  • April 2008 (5)
  • March 2008 (2)
  • February 2008 (3)
  • January 2008 (1)
  • December 2007 (6)
  • November 2007 (9)
  • October 2007 (1)
  • September 2007 (2)

Categories

Tag Cloud

adobe apache Architecture book review C++ centos client server architecture Custom Components database Design error message fedora flash catalyst flex Flex 3 Flex 4 fms iis 6 Interaction Design load balancing master-master master-slave mod_proxy_balancer Monkey Patching MySQL no protocol p2p peer to peer Perl PHP Red5 regex replication self registration selinux Shell Scripting shortcut manager skins socket policy file sockets states stored procedures stratus tools workflow

Coworkers

  • Casey Jackman
  • Sean Murphy

Family

  • Emily & CJ
  • Family Blog
  • Gary Dusbabek

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

RSS FlexExamples

  • Setting the header height on a Spark Panel container in Flex 4
  • Adding a hover glow filter to an MX Image control in Flex 4
  • Fading an item renderer background fill on a Spark List control in Flex 4
  • Setting the border color on the MX Accordion container headers in Flex
  • Setting the tab width on an MX TabNavigator container in Flex 3

Spam Blocked

842 spam comments
blocked by
Akismet

Sponsored Links

JUICE Chat

BYU Adobe Users Group


Copyright © 2010 All Rights Reserved
Flexx Theme by iThemes
Powered by WordPress