Great news, guys! Apache 2.2 is in unstable now. I was very discouraged when tried to do apt-get install apache2-utils and it proposed me to remove apache2 and install it again :-) I decided to install new version to test rails with Apache 2.2, mod_proxy_balancing and mongrel. In this post I’ve described my adventures (or misfortunes?)
First, I need to describe my current Apache 2.0 configuration: I have SVN module enabled with auth_digest module and rails with fcgid. Fist thing I’ve seen was error during upgrade:
1 | Starting web server (apache2)...Syntax error on line 32 of /etc/apache2/mods-enabled/dav_svn.conf: Invalid command "AuthUserFile", perhaps misspelled or defined by a module not included in the server configuration failed! invoke-rc.d: initscript apache2, action "start" failed. |
Weird! In Apache 2.2 configuration format has been changed therefor we need to update scripts:
1 2 3 4 5 6 | AuthType Digest AuthName SVN AuthDigestDomain "/" AuthDigestProvider file AuthUserFile /var/www/svn/passwd AuthzSVNAccessFile /var/www/svn/authz |
Started! But what about rails? It does not working at all. Instead of my application I see contents of dispatch.fcgi! Looks like no fastcgi module installed therefor I’ve tried to install libapache2-mod-fcgid or libapache2-mod-fastcgi. Both of them are depending on Apache 2.0! Looks like I have no other ways to run application except running it under Mongrel. Here is my configuration:
1 2 3 4 5 6 7 8 9 10 11 12 13 | <Proxy balancer://appsite> BalancerMember http://localhost:3000 BalancerMember http://localhost:3001 </Proxy> <VirtualHost *:80> ServerName appsite.myhost.com ServerAdmin [email protected] Options Indexes FollowSymlinks RewriteEngine On ProxyPass / balancer://appsite/ ProxyPassReverse / balancer://appsite/ </VirtualHost> |
Please note, if you have your url in ProxyPath ended with trailing slash, you need balancer to be ended with trailing slash too. Moreover, in this case you don’t need slash at the end of BalancerMember directive, otherwise you will get routing error in Rails. If you got error “[warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.“, be sure you’ve enabled modules proxy, proxy_balancer, and proxy_http.
Thanks! I’ve been trawling the internets for an hour trying to figure out that “No protocol handler was valid” error. I didn’t have mod_proxy_http enabled :) Good lookin out!
Cheers!
– Stephen
Bigup on the mod_proxy_http thing as well…I was stumped too.
[…] Not sure what to make of that, Google again came to the rescue with this helpful hint. It seems that by default Debian doesn’t include the proxy_balancer or proxy_http modules. I enabled them, restarted Apache, and everything was running smoothly. […]
[…] blog.codahale.com kpumuk.info Bookmark […]
Hello! thanks for fielding this. I came across this searching for the “No protocol handler was valid” error. Also note, if this didn’t solve you issue,… make sure your entry is correct:
Thanks about proxy_http. I had proxy_ajp, proxy, and proxy_balancer and for the life of me couldn’t figure out why it wasn’t working :)