Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

Groups in Apache

Hello..........
I have a really easy question.
How do I add groups to Apache web server?
How do I add/remove users to groups?
regards
....Ricky
0
rickyr
Asked:
rickyr
  • 2
1 Solution
 
samriCommented:
ricky,

>>How do I add groups to Apache web server?
This is a bit confusing.  Do you mean the group membership of apache userid belongs to (UNIX env)?
Or, do you mean Group membership for Authentication.

I would presume that you meant the latter - for authentication.

Basically, user and group works quit closely. In other words, you need to have a userfile which contains a username:password pair, and the group file would contains groupname: members1, member2, .. member pair.

>>How do I add/remove users to groups?
First, you need to manipulate userfile to manage your userlist.  you will need to use htpasswd utility that comes with Apache dist to manage users for Basic Authentication, or htdigest for Digest Authentication.

To create users;
Initial:
htpasswd -c password.file username
To add:
htpasswd password.file username
For each cases, you will be prompted for password.

Same thing applies for Digest Authentication.

The group file will be a plaintext file.  Assuming you had password.file with these users;
---password.file
samri:<encrypted-passwd>
rickyr:<encrypted-passwd>
user1:<encrypted-passwd>
user2:<encrypted-passwd>
user3:<encrypted-passwd>
guest1:<encrypted-passwd>
guest2:<encrypted-passwd>
guest3:<encrypted-passwd>
guest4:<encrypted-passwd>
----group.file
admin: rickyr, samri
user: user1, user2, user3
guest: guest1, guest2, guest3

And you .htaccess file would be:
-----.htaccess
AuthType Basic
AuthName "Apache Admin Guide Authors"
AuthUserFile /path/to/user.passsword
AuthGroupFile /path/to/group.file
Require group admin

This would only rickyr and samri would be allowed to access the resources.

Plain word: You just need to use your favourite text editor to manage the group file :) Cool huh !

More detailed information:
http://httpd.apache.org/docs/
http://httpd.apache.org/docs/howto/auth.html

good luck.
0
 
samriCommented:
ricky,

still puzzled, and need more assistance?
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now