13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 7 ■ WORKING WITH APACHE■ Note This kind of single username/password access, where everyone uses the same authorization, is not verysecure! Be careful how sensitive the information is that you protect in this way. However, it’s useful if yourintention is simply to keep the information off the public Internet at large.7-6. Securing Your Web Site: Apache with KerberosYou may have parts of your web site that you want only your users to be able to access or a section thatyou want people to log into as themselves. If you’re running a ticketing system or anything of that sort,then this is particularly useful. For some of these options, htaccess is useful (see recipe 7-5), but if youwant individual users to log in as themselves, then tying authentication in with Kerberos is by far thebest bet. This means that you don’t have to repeat your username/password setup; you can just usewhat you already have established.■ Note This does assume that you already have Kerberos set up! See Chapter 2. Alternatively, you can use themod_authnz_ldap module (a2enmod authnz_ldap in Debian), which works with LDAP auth and with ActiveDirectory.The module you want is mod_auth_kerb, which is available from http://modauthkerb.sourceforge.net/ or in Debian/Ubuntu as the libapache2-mod-auth-kerb package.To install it, add this line to your Apache config file (or for Debian/Ubuntu, run a2enmodmod_auth_kerb):LoadModule auth_kerb_module /usr/lib/apache2/modules/mod_auth_kerb.soYou also need to set up a keytab for Apache to use. Run kadmin -p krbadm from your Apache server,and then execute these commands:> addprinc --randkey HTTP/webserver.example.com@EXAMPLE.COM> ktadd -k /etc/apache2/apache2.keytab HTTP/webserver.example.com@EXAMPLE.COMAfter this, set the correct permissions for the keytab; it should be readable only by the Apache2process:chown www-data /etc/apache2/apache2.keytabchmod og-r /etc/apache2/apache2.keytab169Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!