A short example

well, let me asume you have following apache config and you want to restrict access to some pages

<VirtualHost 192.168.23.3:80>
  
  ServerName www.foo.com
  ServerAlias foo.com
  DocumentRoot ... 
  ....
  
</VirtualHost>


<VirtualHost 192.168.23.3:80>
  
  ServerName www.bar.com
  ServerAlias bar.com
  DocumentRoot ... 
  ....
  
</VirtualHost>
You need to insert following data into the tables: Table host_info: # Note: The fields id, created, updated and is_admin are optional. # They are used for logging and give "superuser"-rights to this person # in the php-frontend application to manage the username and # passwords.
 insert into host_info(id,host,hostgroup) 
   values ( null, "www.foo.com", 1 );

 insert into host_info(id,host,hostgroup) 
   values ( null, "www.bar.com", 2 ); 

Table user_info:

 insert into user_info (id, user_name,user_password, hostgroup) 
   values (null,"myself", encrypt("secret"),1);

 insert into user_info (id, user_name,user_password, hostgroup) 
   values (null,"myself", encrypt("password"),2);

This allows access for user "myself" with the passsword "secret" to protected pages from the host www.foo.com or foo.com. another user called "myself" with the password "password" can access the protected pages from the host www.bar.com or bar.com

if you add now a third virtual host to the apache conf file:

<VirtualHost 192.168.23.3:80>
  
  ServerName my.foo.com
  ServerAlias www.my.foo.com
  DocumentRoot ... 
  ....
  
</VirtualHost>
and you insert
 insert into host_info(id,host,hostgroup) 
 values ( null, "my.foo.com", 1 );

into the host_info table. the user "myself" with the passsword "secret" can access to the protected pages from the host my.foo.com or www.my.foo.com.

Group access

Basic: it works the same way:
  insert into user_group(user_name, user_group, host_group)
    values ("myself", "admin", 1 );
  insert into user_group(user_name, user_group, host_group)
   values ("you", "admin", 1 );

of course you need to add the user "you" to the user table:

  insert into user_info (id, user_name,user_password, hostgroup) 
   values (null,"you", encrypt("access"),1);

With this configuration the user "myself" or "you" can access to group-protected pages ( require group admin ) on the virtualhosts foo.com or my.foo.com

Important is, that the passwords are stored encrypted. I do not want any cleartext passwords in a database, so the module doesn't support it ( of course you may put some code into the source to support it).

I hope you'll see how you should use the module.

Important: you need still the .htaccess files !

uh / 4-jun-2002