Return to Site Surgeon Homepage.
I have set up two directories which are protected seperately:
If you try to access these locations or any files inside them, it will display your browser's default prompt for entering authorisation details. Various online systems use this prompt to protect their content from unauthorised users. If you enter the incorrect details, the server response with a "Error 401: Authentication Required" status page.
I use custom status pages on Site Surgeon and can make them for other projects.
When a user requests to access any part of a website:
I set this example up using cPanel server management software, which simply provides a nice interface for using common features of Apache Web Server. Apache is by far the most common server system in use worldwide, making this system fairly easy to implement for any project.
A special file called .htaccess is created in the protected folder. For the Student Area it contains this data:
AuthType Basic
AuthName "Staff Area"
AuthUserFile "/home/ben/.htpasswds/!dev/http-authorisation/staff/passwd"
require valid-user
What this data means:
AuthType BasicAuthName "Staff Area"") when describing to the protected resource in its authorisation prompt.AuthUserFile "/home/ben/.htpasswds/!dev/http-authorisation/staff/passwd"require valid-userAnother special file is created in a special system directory of the server. This area cannot be accessed publically to improve security. For the Student Area the file was created here:
/home/ben/.htpasswds/!dev/http-authorisation/staff/passwd
The contents of this file are:
student:pNfn.4dMNE/76
What this data means:
student:pNfn.4dMNE/76If several users should have access to the area, each user is placed on a new line.
I used Monash Unversity's HTTP User Authentication notes to understand the physical details of the server configuration.