three stacks of high society


Engineer and open source software advocate living and working in Austin, Texas

Gentoo upgrade to Apache 2.2

I upgraded my server's apache from 2.0 to 2.2 today (see Overview of new features in Apache 2.2) and it was painless except for a few minor hiccups. I like to keep my server's packages up to date with Gentoo's stable packages not just for new features but mainly to make package upgrades as easy as possible. I find that by staying up to date with upstream stable packages, upgrades are more incremental and rarely cause as much difficulty as having to upgrade from multiple major versions behind.

With Gentoo, the Apache 2.2 upgrade came with a routine:

emerge --sync
emerge -uDav world

I noticed the new Apache version, checked out the other packages listed, and then hit enter to proceed. At the end of the compilation, Gentoo reminded me there are new config files in /etc to merge. Luckily for me, I've maintained a clean separation of Apache configuration directives and VirtualHosts, so I was able to accept all of the major configuration directive changes without modification (2.2 mostly just moves around the default directives to more logical locations). Staying up to date and close to upstream shows its benefits here.

Apache restarted without complaining, but attempts to access any of my virtualhosts resulted in a 403 Forbidden:

[Sat Sep 08 13:30:55 2007] [error] [client 89.14.247.41] client denied by server configuration: /home/victor/public_html/

This was caused by Apache 2.2's /etc/apache2/modules.d/00_default_settings.conf:

<Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
</Directory>

You can either override this manually in every vhost.d/*.conf file, or you can just change the "Deny from all" line to "Allow from all" and then make Deny rules manually in each vhost.d file (if you wish). I restarted apache and refreshed my test site, but there was now a new problem - .php files were being parsed as plain text, which meant Apache wasn't passing off .php files for processing.

I added "-D PHP5" to my /etc/conf.d/apache2's APACHE2_OPTS line, which tells Apache to load the PHP5 module. However, since my libphp5.so was built for my old Apache, I had to re-compile for Apache 2.2:

emerge -av php

I waited a few minutes, restarted apache, and now everything works beautifully.

Thanks, I needed that

I ran into the same problem after doing a complete rebuild of my server. (It wasn't planned, but long story short, trying to re-emerge after a gcc upgrade and switch to a newer profile should never be attempted in the midst of a busy, noisy house, especially when you can fat-finger a command like emerge -D world and have it turn into emerge -C world when you aren't really paying attention - DOH!)

Anyhow, it gave me the opportunity to upgrade everything and get a fresh build, but I was running into the 403 error after going from 2.0.49 to 2.2.6 (tells you how long since I rebuilt, eh?) I knew something looked fishy about that file, but after all the long hours rebuilding the entire system and setting up the old Postfix-Courier-MySQL with Cyrus-sasl I was just too cross-eyed to see it. :-/

Again, thanks!

Here is what to do if major Apache update was a surprise to you

Hi

I've wrote an article about it after going into the trouble Upgrade to Apache 2.2 on Gentoo (PHP5 SVN SSL) ...

Here is how it starts: "Recently I've upgraded the Apache on my gentoo server from 2.0 to 2.2.
Because it looked like just the minor change in numbers I ahven't even read the documentation. Silly me.
Everything stopped. SSL, SVN and even PHP ..."

If I would have this article before ...

Cheers

Saved my bacon

Man, I can't thank you enough. I have searched for hours and you are the only one with an answer that made sense and worked. Thank you. The Gentoo documentation never mentioned anything about this in their upgrade explanations.

Thanks

That was what I needed!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m].
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Random Flickr photos

cannstatter volksfest 2007Malo Grablje, Hvar, CroatiaIMG_7040beachHiking the Surenenpasscannstatter volksfest 2007

Blame me for

ClemsonTALK - Clemson's largest forum
Clemson Wiki Project - Clemson oriented Wiki