此内容没有您所选择的语言版本。
6.2. mod_auth_kerb Example
This section contains instructions for a basic example for configuring Kerberos authentication with Red Hat JBoss Web Server's Apache HTTP Server and mod_auth_kerb on Red Hat Enterprise Linux.
6.2.1. mod_auth_kerb Example Prerequisites 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The following is a list of prerequisites for the working example. Ensure that all prerequisites are met before attempting to use the example instructions.
- Install mod_auth_kerb on Red Hat Enterprise Linux.
- Install curl with GSS-negotiated support.
- Configure and run a Kerberos or LDAP server (for example ApacheDS) on the same host as your Red Hat JBoss Web Server.
- Create the following LDAP users:
- Create the user
krbtgt
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the user
ldap
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the user
HTTP
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create user
hnelson
(test user):Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2.2. Configure the Kerberos Client 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Use the following procedure to configure a Kerberos client for testing purposes:
Procedure 6.1. Configure the Kerberos Client
Create the Kerberos Configuration File
Create thekrb5.conf
configuration file in the/etc
directory and add the following to the file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Key Tab
Create a key tab in the/etc/httpd
folder with the following contents:Copy to Clipboard Copied! Toggle word wrap Toggle overflow As the root user, run the following commands to apply the correct group and permissions to the key tab:chgrp apache /etc/httpd/krb5.keytab chmod 640 /etc/httpd/krb5.keytab
# chgrp apache /etc/httpd/krb5.keytab # chmod 640 /etc/httpd/krb5.keytab
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the Hosts File
Ensure that the following host configuration is included in the/etc/
hosts
file:127.0.0.1 localhost
127.0.0.1 localhost
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2.3. Configure mod_auth_kerb 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Use the following procedure to configure mod_auth_kerb. As a prerequisite, ensure that the Kerberos Client is configured (see Section 6.2.2, “Configure the Kerberos Client”).
Procedure 6.2. Configure mod_auth_kerb
- Create the
auth_kerb.conf
configuration file in theJWS_HOME/httpd/conf.d/
folder and add the following information to the file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2.4. Test the Kerberos Authentication 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Use the following instructions to test the Kerberos authentication. As a prerequisite for this procedure, ensure that the Kerberos Client is configured (see Section 6.2.2, “Configure the Kerberos Client”).
Procedure 6.3. Test the Kerberos Authentication
Create a Test Page
Create a test page namedauth_kerb_page.html
inJWS_HOME/httpd/www/html/kerberostest/
.Add the Contents of the Test Page
Add the following contents to the test page (auth_kerb_page.html
):<html> <body> <h1>mod_auth_kerb successfully authenticated!</h1> </body> </html>
<html> <body> <h1>mod_auth_kerb successfully authenticated!</h1> </body> </html>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Set Log Level
Optionally, set the log level for debugging inJWS_HOME/httpd/conf/httpd.conf
.Start httpd
The the Installation Guide for details.Test Authentication
Test the authentication as follows:- Initiate Kerberos authentication for the test user
hnelson
:kinit hnelson
$ kinit hnelson
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - View the details for the test user
hnelson
:klist
$ klist
Copy to Clipboard Copied! Toggle word wrap Toggle overflow A result similar to the following appears:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Testing Apache HTTP Server Kerberos Authentication
Test Apache HTTP Server Kerberos authentication as follows:curl --negotiate -u : http://localhost/kerberostest/auth_kerb_page.html
$ curl --negotiate -u : http://localhost/kerberostest/auth_kerb_page.html
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If working correctly, the following result appears:<html> <body> <h1>mod_auth_kerb successfully authenticated!</h1> </body> </html>
<html> <body> <h1>mod_auth_kerb successfully authenticated!</h1> </body> </html>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
See http://modauthkerb.sourceforge.net/ for more information about mod_auth_kerb.