Solved

Perl Password protection

Posted on 1999-01-21
4
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Six Sigma Control Plans

717 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