Revision of Apache from Thu, 10/20/2011 - 15:32

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Apache has been the most popular web server on the Internet since April 1996.

Installation
Download the latest version of the Apache web server. At the time of writing, the current version was 2.2.21.

cd /extra/src
wget http://apache.mirror.rafal.ca/httpd/httpd-2.2.21.tar.gz
tar zxf httpd-2.2.21.tar.gz
cd httpd-2.2.21

In order to secure parts of our website, we'll enable mod_ssl. Compiling mod_rewrite is useful for rewriting URLs. Drupal, in particular, makes use of this.

./configure --enable-so --enable-ssl --enable-rewrite

If all configures correctly, make and install the binaries:

make
make install

Edit /usr/local/apache2/conf/httpd.conf and change the user and group from daemon to nobody:

User nobody
Group nobody

Confirm that Apache starts up correctly, then stop it again:

/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl stop

Automatic Startup
There's a number of different ways to get Apache to start automatically (rc.d/init.d script, rc.local, xinetd). We're going to use daemontools.
If you haven't already, install daemontools.

Create a directory for the Apache service:

mkdir -m 1755 /var/service/apache
cd /var/service/apache

Create the run script and make it executable:

echo '#!/bin/sh' > run
echo 'exec 2>&1' >> run
echo 'exec /usr/local/apache2/bin/httpd -DNO_DETACH 2>&1' >> run
chmod 755 run

Our log script comes from John Simpson's:

mkdir -m 755 log
cd log
wget http://qmail.jms1.net/scripts/service-any-log-run
mv service-any-log-run run
chmod 755 run

Finally, add the service to daemontools by creating the symbolic link in /service

ln -s /var/service/apache /service/apache

Confirm that the service is running:

svstat /service/apache /service/apache/log

Recent Updates

  • 1 week 6 days ago
    1.27.2 update
  • 3 weeks 3 days ago
    Drupal 10/11 config
  • 3 weeks 4 days ago
  • PHP
    3 weeks 4 days ago
    PHP 8.3.11 and AlmaLinux
  • 3 weeks 5 days ago
    New version of Pound