Solved

Perl Password protection

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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