Apache won’t start after upgrading to 2.2.21 in FreeBSD 8.2

Apache 2.2.21 was rolled out today. Since it has some security fixes, I decide to put a new version on my server farm. I didn’t know that it becomes a small headache today morning.

The upgrade was running smooth, no error messages, no complaints, until I restart the Apache server manually

sudo apachectl restart

And guess what, my website didn’t show up on the browser. Instead, I saw the following picture on my browser:

That was not fun at all. So I decided to investigate what was wrong to the upgrade.

sudo tail /var/log/httpd-error.log

And I found something interesting:

httpd: Syntax error on line 100 of /usr/local/etc/apache22/httpd.conf:
Cannot load /usr/local/libexec/apache22/mod_negotiation.so into server:
/usr/local/libexec/apache22/mod_negotiation.so: Undefined symbol "ap_set_accept_ranges"

Therefore, I edited my Apache configuration and commented out that module:

#LoadModule negotiation_module libexec/apache22/mod_negotiation.so

Saved the file and restarted the server again. Now the problem is gone!

sudo apachectl stop
sudo apachectl start

When I tried to visited the website again, I found that the speed is bit slow. I think it has something to do with the mod_negotiation.so. I decided to rebuild the Apache.

cd /usr/ports/www/apache22
sudo make config

Make sure that the Negotiation: Enable mod_negotiation is checked.

sudo make

Running sudo make is enough. You don’t need to re-run sudo make install or sudo make reinstall.

This will rebuild the necessary libraries including the missing mod_negotiation.so.

Go back to the configuration file and enable the module again:

LoadModule negotiation_module libexec/apache22/mod_negotiation.so

Restart the server:

sudo apachectl restart

That’s it! Happy Apaching!

–Derrick

Our sponsors:

4 comments

  1. I ran into this problem, but I already had mod_negotiation enabled in my apache22 configuration. A graceful restart was apparently not sufficient (as a previous commenter); I needed to completely restart. I would have expected that a stop and start in your case would have worked.

    Also when you write that “sudo make is enough”, please note that that just recompiles the apache22 port, but does *not* install any of the new files in place. So I doubt that had any effect.

    1. Hi Bruce,

      Thanks. In theory, “sudo make” should compile the port only. However, if the selected port requires other ports, the system will compile and install other required ports first, and compile the selected port only. I guess it is the case in this situation.

      –Derrick

Leave a Reply

Your email address will not be published. Required fields are marked *