Home arrow Site Administration arrow Page 4 - Getting More Out Of Apache (Part 2)

Grouping Things Together - Administration

Learn more about the world's best-loved Web server, with examplesof Apache's authentication and logging capabilities, and also pay a briefvisit to its unique URL re-writing module.

  1. Getting More Out Of Apache (Part 2)
  2. Eyes Only
  3. Identity Check
  4. Grouping Things Together
  5. Timmmmmmbbbbberrrr!
  6. When Things Go Wrong
  7. Just Rewrite It!
  8. Putting It Into Practice
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 1
January 23, 2001

print this article


In addition to user-level access, Apache also allows you to createdifferent groups of individual users, and restrict access to protectedresources based on group membership. For example, let's assume that I havetwo groups, "accounts" and "admin", and I would like to restrict access toa directory only to members of the "accounts" group.

The first thing to do is change the ".htaccess" file in the directory toread

AuthType Basic AuthName "Top-Secret Information" AuthUserFile /usr/local/apache/auth/mfre/users AuthGroupFile /usr/local/apache/auth/mfre/groups require group accounts
Next, you need to create the group memberships file, as specified in theAuthGroupFile directive above. This file is extremely simple - here's whatit looks like:

$ cat groups admin: bill harry accounts: joe beth
Translation: users "joe" and "beth" are members of the group "accounts",while "bill" and "harry" are members of the group "admin".

Now, when you navigate back to the protected directory in your Web browser,Apache will again ask you for authorization; however, only members of thegroup "accounts" will be permitted to view the contents of the directory.

Finally, you can allow or deny access based on host names - the followinglines would deny access to the protected resource for all requests fromdomains other than "melonfire.com"

order deny,allow deny from all allow from melonfire.com

>>> More Site Administration Articles          >>> More By icarus, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates


Dev Shed Tutorial Topics: