Solved

Perl Password protection

Posted on 1999-01-21
4
154 Views
Last Modified: 2010-03-05
I need a program to ask users for a password so they can load an html page. Something like the Experts-exchange have, to ask their user passwords.
0
Comment
Question by:jcao
  • 2
4 Comments
 

Author Comment

by:jcao
ID: 1210231
Edited text of question
0
 
LVL 4

Expert Comment

by:martinag
ID: 1210232
Are you using Apache as server software (if it's a UNIX, then it's most likely Apache)? I can give you a solution for it.

Martin
0
 

Accepted Solution

by:
hap earned 100 total points
ID: 1210233
Assuming your using Apache like everyone else, you can find more than 20 password protection scripts at:
http://www.freeperlcode.com/guide/Password_Protection/

However, if you want to do it yourself:
---------------------------------------------------------------------------------
Multiple User/Group Protection:

     1. Create the directory your want to protect.

     2. Create a file .htgroup that contains the group name and list of users:

                 member-users: user1 user2 user3

     3. Modify .htaccess, so it looks similar to:

                 AuthUserFile /homeX/domain/.htpasswd
                 AuthGroupFile /homeX/domain/.htgroup
                 AuthName ByPassword
                 AuthType Basic

                 &ltLimit GET>
                 require group member-users
                 </Limit>

     4. Create the password file .htpasswd using the program htpasswd for
        each user (as above in part 1) You don't need the -c option if you
        are using the same .htpasswd file (-c is used to create a new file).

         htpasswd /homeX/domain/.htpasswd user1
         htpasswd /homeX/domain/.htpasswd user2
         and so on...

     5. Remember to add any new users to the .htgroup file.

     6. Now try to access a file in the protected directory by entering the
        set username and password when prompted for it.


     Notes: All files should have a blank line at the bottom and always use the
            full path to your configuration files;

            Replace "/homeX/domain/" with your server path to .htpasswd file;

            You may need to replace "/usr/local/bin/" with "/usr/bin/"


0
 

Author Comment

by:jcao
ID: 1210234
Thank you very much.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
perl match and sort unique result 2 141
perl script help 12 105
Writing a parser for java language 4 83
Log File Creation with Header and Footer 17 127
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question