This chapter includes applications that respond to requests originating from LAN, intranet and internet clients. Specifically covered are HTTP requests and FTP requests.
The Apache package contains an open-source HTTP server. It is useful for creating local intranet web sites or running huge web serving operations.
Download (HTTP): http://www.apache.org/dist/httpd/httpd-2.0.49.tar.gz
Download (FTP): ftp://ftp.tux.org/pub/net/apache/dist/httpd/httpd-2.0.49.tar.gz
Download size: 5.7 MB
Estimated Disk space required: 75 MB
Estimated build time: 1.32 SBU
For security reasons, running the server as an unprivileged user and group is strongly encouraged.
groupadd apache &&
useradd -c apache -d /dev/null -g apache -s /bin/false apache
The following patch will define the layout of destination directories and, among them, the build directory at /usr/lib/apache/build. This will allow the modules added to Apache to be configured without errors. Apply the patch:
patch -Np1 -i ../httpd-2.0.49-config.patch
Build and install Apache by running the following commands:
./configure --enable-layout=LFS \
--enable-mods-shared=all &&
make &&
make install
--with-expat=/usr: Uses system installed expat. If you have installed expat and do not use this switch, the apache installation may overwrite some files from the expat installation.
--enable-mods-shared=all: We want modules to be compiled and used as Dynamic Shared Objects (DSOs) so they can be included and excluded from the server using the run-time configuration directives.
--enable-ssl: Use this switch to create the mod_ssl module and enable SSL support.
The main configuration file is called httpd.conf. Modify it to run the server as a dedicated user:
sed -i -e "s%User nobody%User apache%" -e "s%^Group #-1%Group apache%" /etc/apache/httpd.conf
See http://httpd.apache.org/docs-2.0/configuring.html for detailed instructions on customizing your Apache HTTP server.
Install the /etc/rc.d/init.d/apache init script included in the blfs-bootscripts-5.1 package.
make install-apache
The Apache package provides ab, apachectl, apr-config, apu-config, apxs, checkgid, dbmmanage, htdbm, htdigest, htpasswd, httpd, instdso.sh, logresolve, rotatelogs, libapr, libaprutil and various modules.
apachectl is a front end to the Apache HTTP server which is designed to help the administrator control the functioning of the Apache httpd daemon.
dbmmanage is used to create and update the DBM format files used to store usernames and passwords for basic authentication of HTTP users.
htdigest is used to create and update the flat-files used to store usernames, realms and passwords for digest authentication of HTTP users.
htpasswd is used to create and update the flat-files used to store usernames and passwords for basic authentication of HTTP users.
logresolve is a post-processing program to resolve IP-addresses in Apache's access log files.