HP Open Source Middleware Stacks Blueprints: LAMP Architecture on HP ProLiant BladeSystem Servers on SLES
Configuring Apache Web Server Services
Use the following procedure to configure the Apache Web server services:
1. Edit the following /etc/sysconfig/apache2 file by adding the modules ldap and
authnz_ldap to the APACHE_MODULES line:
After completing this edit, the line should look like the following:
APACHE_MODULES="... ... ldap authnz_ldap"
2. Create the following file:
/srv/www/htdocs/foo/index.html
Add the following lines to the preceding file:
<HTML>
<HEAD>
<title>Test Apache & CDS integration</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
</HEAD>
<BODY>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm">
<FONT FACE="Times New Roman, serif" SIZE=6>
Directory foo succeed! </FONT>
</P>
</BODY>
</HTML>
3. Edit the following file:
/etc/apache2/default-server.conf
Add the following lines to the preceding file:
<Directory "/srv/www/htdocs/foo">
Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
AuthType Basic
AuthName Internal
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPURL ldap://<YOUR_LDAP_SERVER_IP>/dc=osm,dc=example,dc=com?uid??(objectclass=*)
Require ldap-group cn=tomcat,ou=groups,dc=osm,dc=example,dc=com
AuthLDAPBindDN cn=Manager,dc=example,dc=com
AuthLDAPBindPassword secret
</Directory>
4. Restart Apache by entering the following command:
# /etc/init.d/apache2 restart
5. Verify that the Apache LDAP authentication is operating properly by navigating to the
following website at:
http://<YOUR_WEB_SERVER_IP>/foo/
6. When prompted, log in with the user name tomy and the password tom.
The login fails, the following message appears:
Authorization Required
The tomy user does not belong to the tomcat group so the authentication failed. This failure
proves that the Apache Web server authentication services are operating properly. This can
be further proved to be true by entering the user name benw and password ben and the
following message displays:
The Authentication and Authorization worked !
26