" As one of the leaders in the provision of web presence and network
solutions, we can offer our clients the most competitive prices available. "
Tue Apr 16 12:05:59 CEST 2024
  Search :   
TECHNICAL FAQ Technical FAQ Password protection
NetCulture network information
The NetCulture speed commitment
Domain names explained
Secure transaction accounts (SSL)
FrontPage extensions
Administration of your account
Configuring POP accounts
The web language 'html'
Web page forms
Analysis of your web site
Page counters
Password protection
Automatic language detection
Using CGI
Using PHP for easy CGI
On-Line databases using MySQL
Mail handling on your account
Mailing lists (Majordomo)



The NetCulture systems all use the Apache web server. This allows, among other functions, the ability to restrict access to your web site by user names or group names.

We would suggest taking a look at the current Apache documentation, but below are some general guidelines.

There are two types of authentication, basic and MD5. The majority of current browsers being used should accept the basic but not necessarily MD5. We will only therefore discuss ‘basic' here.

For example, let's say that you wanted to password protect a directory called ‘database'. Firstly you will need to put a file called '.htaccess' in the 'database' directory with the following content :-

AuthUserFile /otherdir/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic

<Limit GET>
require user my-group-of-users
</Limit>


Note that this will limit only the GET procedure, to limit other i.e. POST or CGI, then edit the line as follows :-

<Limit GET POST PUT>

The next task is to create the actual password file. This is done using the ‘htpasswd' utility as follows :-

$ htpasswd -c /otherdir/.htpasswd jbloggs

where ‘otherdir' is what you specified in the ‘.htaccess' file and ‘jbloggs' is the name of the new user to create. NB. The ‘-c' option creates a new file, to enter other users into an existing ‘.htpasswd' file then this should be omitted. After enter, you will be prompted to enter and also confirm the password.

Next we need to create the group file with all the user names who are valid for the ‘my-group-of-users'. In the same directory as the ‘.htpasswd' file, create a file called ‘.htgroup' with the following contents :-

my-group-of-users: jbloggs bsimpson

That's it. When you try and access the directory where your ‘.htaccess' file resides, either directly, or indirectly (via a hypertext link), you will need to enter a username and password used in the process above.

Please note that there are many variations on the above theme. For further details, take a look at the Apache site documentation.

Site français
Contact us  |  Home
© 1996-2024 NetCulture.   All rights reserved.