Home > English, Tech Crunch > HOWTO Authenticate access to parts of webserver using PAM and Apache

HOWTO Authenticate access to parts of webserver using PAM and Apache

This article is incomplete and was first written in June 2006
for the BeezNest technical website (http://glasnost.beeznest.org/articles/337).

To require authentication of parts of a webserver using PAM and Apache. That way, you can require a user or users of a group to enter a valid username and password to access some parts of your website using PAM, the default authentication infrastructure on most Unices.

To do this, you need first to install the appropriate PAM authentication module for Apache. For Apache 2.x on Debian (starting from Sarge), this is located in the package libapache2-mod-auth-pam.

You need then to add something similar to the definition of you virtual host and reload your Apache daemon:

<Directory /var/www/myrestrictedarea>
        AuthType Basic
        AuthName "Restricted area for My Server"
        AuthPAM_Enabled On
        Require group mygroup
</Directory>
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: