Upgrading Apache to version 2.2 in Debian

Posted by Dmytro Shteflyuk on under Ruby & Rails

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:

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:

<Proxy balancer://appsite>
    BalancerMember http://localhost:3000
    BalancerMember http://localhost:3001

<VirtualHost *:80>
    ServerName appsite.myhost.com
    ServerAdmin [email protected]
    Options Indexes FollowSymlinks
    RewriteEngine On
    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.

6 Responses to this entry

Subscribe to comments with RSS

said on November 15th, 2006 at 22:40 · Permalink

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!


– Stephen

said on December 18th, 2006 at 11:49 · Permalink

Bigup on the mod_proxy_http thing as well…I was stumped too.

said on December 18th, 2006 at 16:08 · Permalink

[…] 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. […]

c a
said on November 19th, 2008 at 17:56 · Permalink

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:

RewriteRule ^/(.*)$ balancer://YOURAPP%{REQUEST_URI} [P,QSA,L]
said on January 20th, 2009 at 04:33 · Permalink

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 :)

Comments are closed

Comments for this entry are closed for a while. If you have anything to say – use a contact form. Thank you for your patience.