easy log-in page
situation: there is a web page that you want a few people to see and no one else. once these people access the page, nothing changes determined by his/her identity. that is, there is no need to track who of the authorized group is visiting the page.
there is no need for session management like could be implemented with php or perl. instead, there is a simple manner for linux which pops up a log in prompt when a user tries to access the restricted page. in this prompt, the user enters a username and password and if authenticated, the restricted page appears.
(1) in the directory containing the web pages to be restricted, create a file called .htaccess. this file should contain 4 lines:
AuthUserFile /full/path/to/.htpasswd
AuthName "message that displays in log in prompt"
AuthType basic
Require valid-user
(2) create the password file and the first authorized user with:
htpasswd -c .htpasswd roger
(3) enter a password for this user
(4) for more users (not creating a new file now):
htpasswd .htpasswd bob
(5) enter password. this is optional.
(6) go to the page in a browser and test the log in.
there is no need for session management like could be implemented with php or perl. instead, there is a simple manner for linux which pops up a log in prompt when a user tries to access the restricted page. in this prompt, the user enters a username and password and if authenticated, the restricted page appears.
(1) in the directory containing the web pages to be restricted, create a file called .htaccess. this file should contain 4 lines:
AuthUserFile /full/path/to/.htpasswd
AuthName "message that displays in log in prompt"
AuthType basic
Require valid-user
(2) create the password file and the first authorized user with:
htpasswd -c .htpasswd roger
(3) enter a password for this user
(4) for more users (not creating a new file now):
htpasswd .htpasswd bob
(5) enter password. this is optional.
(6) go to the page in a browser and test the log in.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home