Apache ports for CRUX

On this website you'll find CRUX ports and informations for apache, the most popular and widely used HTTP server.

Apache is highly configurable and also a very complicated piece of software. Each user should configure and build his "own" server, that suits best for the specific needs. This page gives you some ideas, how to create your own package for CRUX.

A comprehensive paper howto configure apache and many of it's modules can be found here.

If you only need a fast server for your home-network or even small puplic web pages, I recommend the use of webfs (opt/webfs). Thttpd-php (contrib/thttpd-php) is the right choice if you need also PHP and extended CGI support. Both of them need a minimum of configuration and system resources, and don't cluster your harddisk with a lot of files.

If you created ports for other specialized servers or even modules for apache, I would be happy to include them here.


Download:
All ports for Apache 2.0.x are part of the CLC ports collection, the ports for Apache 1.3.x are no longer maintained by me, but still available for download here.

1. Ports for Apache 2.0.x

1.1. Server ports

1.1.1 apache

Mostly modular, basic server. If you need SSL support, add --enable-ssl to the configure options. WebDAV support is included, see the apache 1.3 mod_dav module for configuration, but skip the LoadModule and AddModule statements.

1.1.2 apache-suexec

Maintained by Matt Housh. Same as above, but with suEXEC support. Use with care.

1.2. Module ports

1.2.1 mod_php

PHP support for apache. Build as external DSO module. After installation you have to edit the configuration file /etc/httpd.conf of apache to enable the php stuff.

Locate the lines where modules will be loaded, and append the following lines to the appropriate places:

LoadModule php4_module lib/apache/libphp4.so

Add the php mime type:

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

Finally you must extend the index list. Change the DirectoryIndex line to:

DirectoryIndex index.html index.html.var index.php index.php3

To verify the PHP installation you can download this test page and rename it to test_php.php.

1.2.2 mod_ruby

mod_ruby embeds the Ruby interpreter into the Apache web server, allowing Ruby CGI scripts to be executed natively. These scripts will start up much faster than without mod_ruby. Together with eruby it's very easy to generate dynamic html pages.

A very good guide how to configure apache for mod_ruby can be found here. With the following simple configuration all *.rhtml files will be parsed by eruby:

LoadModule ruby_module lib/apache/mod_ruby.so

<IfModule mod_ruby.c>
  RubyRequire apache/eruby-run
  <Files *.rhtml>
    SetHandler ruby-object
    RubyHandler Apache::ERubyRun.instance
  </Files>
</IfModule>

1.2.3 mod_perl

I hate perl, anyway a port is available for completeness, but unmaintained. For configuration look here.

1.3. Misc ports

1.3.1 apache-doc

Online manual for apache 2. No longer maintained, a port for version 2.0.46 is still available.


2. Ports for Apache 1.3.x

2.1 Requirements

2.1.1 libmm

The MM library is a 2-layer abstraction library which simplifies the usage of shared memory between forked (and this way strongly related) processes under Unix platforms. Required only for the apache 1.3.x ports.

2.2. Server ports

2.2.1 apache

The port "apache" is a slim server without any extensions, but mostly modular. Almost any module can be build as a DSO outside the apache source-tree, and then be added without any problems to an already installed apache package.

2.2.2 apache-perl-ssl

The port "apache-perl-ssl" is a big server with build-in Perl interpreter and SSL support. Mod_ssl must be build inside the apache source-tree, because the source will be heavily patched by mod_ssl. Perl should not be build as module, because this is a feature marked as experimental. This server can, also be extended later by other DSO modules, of course.

After installation you have to create a self-signed SSL-certificate:

# openssl req -new > my.csr 
# openssl rsa -in privkey.pem -out my.key 
# openssl x509 -in my.csr -out my.cert -req -signkey my.key -days 999 
# cp my.key /etc/apache/ssl.key/server.key 
# cp my.cert /etc/apache/ssl.crt/server.crt 

2.3. Module ports

2.3.1 mod_php

PHP support for apache. Build as external DSO module. After installation you have to edit the configuration file /etc/httpd.conf of apache to enable the php stuff.

Locate the lines where modules will be loaded, and append the following lines to the appropriate places:

LoadModule php4_module lib/apache/libphp4.so
AddModule mod_php4.c

Add the php mime type. Locate the line <IfModule mod_mime.c> and insert somewhere after that line:

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

Finally you must extend the index list. Locate the line <IfModule mod_dir.c>. Change the DirectoryIndex line to:

DirectoryIndex index.html index.htm index.php index.php3

To verify the PHP installation you can download this test page and rename it to test_php.php. If you change your server, e.g. from "apache" to "apache-perl-ssl" you must rebuild this module.

2.3.2 mod_dav

A WebDAV (Web-based Distributed Authoring and Versioning) Module for apache. This is a set of extensions to the HTTP protocol which allows users to edit and manage files on remote web servers.

After installation you have edit the configuration file /etc/httpd.conf of apache to enable this module. Locate the lines where modules will be loaded, and append the following lines to the appropriate places:

LoadModule dav_module lib/apache/libdav.so
AddModule mod_dav.c

Add the following line within the 'Main server configuration' section:

DAVLockDB /tmp/DAVLock

Now you are ready to put a 'DAV On' statement within a <Directory> or <Location> directive.
For example:

<Directory "/home/www/public/">
  DAV on
  AuthType Basic
  AuthName "Users only"
  AuthUserFile /etc/apache/passwords
  Require valid-user
</Directory>

gives all users, registered in /etc/apache/passwords, read/write access to your public directory. You can restrict this more with the usual apache directives. This directory must be owned by the effective user/group, e.g. nobody/nobody, apache is running to allow write access.

The access to a WebDAV enabled apache is much like ftp. A CRUX port for the commandline WebDAV cadaver is available. The sitecopy utility works also, besides ftp, with a WebDAV enabled http servers. See the above informations about downloading this ports.

2.4. Misc ports

2.4.1 apache-doc

The online manual for apache. Of course, this is not CRUX alike, but maybe you will need it to configure apache ;)


Last modified: Mon Sep 08 13:03:45 CEST 2003 Valid HTML 4.01!
Copyright © 2002 by Jürgen Daubert