The Apache web server supports the use of a htaccess
file in order to restrict access to some areas of websites. User names and passwords are maintained by the htpasswd utility, which is part of the main Apache distribution.
The architecture of Apache is very modular, and there is a module that can use PAM for authentication purposes instead of standard htaccess
files. The major disadvantage is that the module is currently not maintained but most current Linux distributions and FreeBSD do include the module.
The module provides the usual htaccess
authentication, but in addition it is possible to require membership of a particular group (the /etc/group
in traditionally UNIX authentication). The Debian/Ubuntu developers have split the PAM authentication module in two packages. Installation is straightforward:
# sudo apt-get install libapache2-mod-auth-pam # sudo apt-get install libapache2-mod-sys-group
The latter command installs the module for checking group membership...