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:
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:
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:
ServerAdmin [email protected]
Options Indexes FollowSymlinks
ProxyPass / balancer://appsite/
ProxyPassReverse / balancer://appsite/
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!
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 :)