Solved

Perl Password protection

Posted on 1999-01-21
4
151 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now