?
Solved

How to create password protected directory

Posted on 2003-10-21
7
Medium Priority
?
1,437 Views
Last Modified: 2010-03-04
hello, everybody?

Does anybody can teach me how to create a password protected directory at Sun Solaris system? My web server is Apache. any I donot have access to httpd.conf file. I guess I have t do this by using .htaccess file or is there any other solutions? THanks very much.

0
Comment
Question by:Maggie_li
[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
  • 5
  • 2
7 Comments
 
LVL 15

Expert Comment

by:periwinkle
ID: 9594341
Hi Maggie -

If you do not have access to the httpd.conf file, then you would do this via a .htaccess file (as long as your server admin has given you permission to do so).

There's a good basic article on this at:

http://www.apacheweek.com/issues/96-10-18#userauth

If you'd like a way of managing your password files without ssh or telnet access, you might consider using a program like Access Denied:

http://solutionscripts.com/warehouse/access_denied/index.shtml
0
 

Author Comment

by:Maggie_li
ID: 9606066
Thank you very much for your help, periwinkle.
but this is a broken link that I can not access it. Could you please give me more information about this topics? Thanks a lot.

0
 
LVL 15

Expert Comment

by:periwinkle
ID: 9606185
Maggie -

I was able to click on both links above???  Which one did you have problems with?
0
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 
LVL 15

Expert Comment

by:periwinkle
ID: 9606197
Here's another link to the Apache.org website that gives the information on .htaccess control:

http://httpd.apache.org/docs/howto/auth.html

0
 
LVL 15

Accepted Solution

by:
periwinkle earned 200 total points
ID: 9606274
Basically, to do user-based authentication, you create a file called .htaccess in the directory that you want to protect (be aware that subdirectories wil be protected as well).  In that file, you place directives:

AuthUserFile /full/path/to/.htpasswd
AuthName "some text you'd like to pop up - like Enter username and password for access to site"
AuthType Basic

<LIMIT GET POST PUT>
require valid-user
</LIMIT>

This refers to a file, which I've called .htpasswd in my example above (but can be called anything) that contains the usernames and passwords.  As you probably are aware, any file that begins with a period is a hidden file.  It's a good idea to put the htpassword file outside of the html hierarchy (if possible), and to start it with a period.

To create the password file, you need to either log on via ssh and use the htpasswd program (which is provided with the Apache distribution) to create the htpasswd file, or use a cgi program such as the Access Denied script that I've given above.

To use the htpasswd command utility, you will use the -c flag only the first time to create the file (if you continue to use it, it will overwrite the file, deleting any previous entries):

htpasswd -c .htpasswd username

it will then prompt you for the password (twice, to make certain that you have entered it properly).

On subsequent times, you'll just use:

htpasswd .htpasswd username
0
 

Author Comment

by:Maggie_li
ID: 9609781
periwinkle,

Thanks very much for your help. I got the problem figured out:-)

I have already accepted your comment as answer. Thanks again,
and have a nice day.

0
 
LVL 15

Expert Comment

by:periwinkle
ID: 9609959
Hi Maggie -

Glad to be of help!

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

752 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