HP Open Source Middleware Stacks Blueprints: LAMP Architecture on HP ProLiant BladeSystem Servers on SLES
2. Locate the following for the directory of /srv/www/htdocs:
AllowOverride None
3. Change the value of AllowOverride from None to AuthConfig:
AllowOverride AuthConfig
Creating a Password File
Create a password file to contain the HTTPS server passwords using the following steps:
1. Create the password directory by entering the following command:
# mkdir /etc/apache2/passwd
2. Create and update the user password file by entering the following command:
# htpasswd -c /etc/apache2/passwd/mypasswords TESTNAME
New password: <*******>
Re-type new password: *******
Creating the Distributed Configuration File
You can create a distributed configuration file which you place in a directory that contains
configuration directives specific to that directory and all its subdirectories. This provides you
the flexibility to define how the entire directory structure is configured on a per-directory basis.
Use the following procedure to create the .htaccess distributed configuration file:
1. Create the following file:
/srv/www/htdocs/test/.htaccess
2. Add the following lines to the file you created in Step 1:
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/apache2/passwd/mypasswords
Require user TESTNAME
Restarting the Apache Web Server
Restart Apache by entering the following command:
# /etc/init.d/apache2 restart
Verifying the Authentication and Authorization Operations
Verify that the Apache Web server authenticates and authorizes server access properly by
performing the following steps:
1. Open a browser window and navigate to the following website at:
http://<YOUR_WEB_SERVER_IP>/test/
2. When prompted, log in with the user name TESTNAME and the password PASSWORD.
If the login succeeds, the following message appears:
The Authentication and Authorization worked !
If the login fails, the following message appears:
Authorization Required
Protecting Apache Web Server Authorization with Symas CDS
Symas CDS is a service that can be used by applications to authenticate users and grant
authorization. It can protect the contents in Apache using an Apache module, mod_authnz_ldap,
within the Linux distribution. Another Apache module, mod_ldap, can also be used as part of
the LDAP connection pooling and resulting cache services. When a request for the protected
24