SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 1999
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am trying to figure out how to password-protect a directory which will contain pages which may be seen only by subscribers. I have a java-script password applet, but my search engine (atomz.com) will not scan pages that use a script for password protection. I understand there is a way (.htaccess? .htpasswd?) to insert files into the directory I'm trying to protect (using telnet), that will then allow the atomz.com search engine to scan them. Problem: how to find the right format for these files--I see different formats offered at different places on the 'Net? Question: can I use .htaccess and .htpasswd files to protect this directory AND STILL GIVE EACH PESON HIS/HER OWN PASSWROD to access them? (Or am I limited to one password for everybody to use,i.e., the same one for all?) If anyone can point me to tutorials or other info on the 'Net on this subject, I'd be very grateful. Thanks a ton.


    ------------------
    Parenting Adolescents
    ---Where parents & teens get expert answers for free.---

  2. #2
    Destiny Manager Plebius's Avatar
    Join Date
    Nov 1999
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apache has all the info about .htaccess and .htpasswd and it is possible to have different passwords for each user
    http://www.apache.org/


    ------------------
    Plebius Press - An independent media network

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 1999
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks to LuZeR at Plebius for pointing me to Apache.com In fact I did find help there under "userauth," but I'm having a heck of a time getting the .htaccess file formatted correctly (apparently--because I get a server error when I test my password-protected page on the browser). I suspect it's a filepath error... I created and installed the .htaccess file in the directory I wanted protected, and then installed the .htpasswd file in my http-docs directory, using telnet. In the .htaccess file, I had to write the path to the .htpasswd file, and I suspect this is where I got screwed up. I HATE the filepath thing! It seems that the path I see used on my FTP client (Cute FTP) is never the same as the one required by the browser! Here's what I put in my .htaccess file--can anyone help me out re where I've gone wrong?

    AuthName "exparchiv"
    AuthType Basic
    Auth/User/File /usr/local/vhost_parentingadolescents.com/http-docs/.htpasswd

    require valid-user


    Now, I suspect that I should maybe be using a www. address for the directory? Or...? Any ideas? (Should I have included the quotation marks on the directory name?)

    Thanks in advance.

    ------------------
    Parenting Adolescents
    ---Where parents & teens get expert answers for free.---

  4. #4
    Destiny Manager Plebius's Avatar
    Join Date
    Nov 1999
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>Auth/User/File /usr/local/vhost_parentingadolescents.com/http-docs/.htpasswd
    <HR></BLOCKQUOTE>

    should be this:

    AuthUserFile /usr/local/vhost_parentingadolescents.com/http-docs/.htpasswd
    AuthGroupFile /dev/null

    it would also be a good idea to keep the .htpasswd file in a non publicly accesible directory, /usr/local/vhost_parentingadolescents.com/.htpasswd might be a good choice


  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 1999
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks to my second respondent! I added the "AuthGroupFile /dev/null" line, and I changed the .htpsswd file to my vhost_parentingadolescents.com directory. I've chmod'ed everything to 755. Things are moving along... now I at least get a Password notice when I try to call up the file in the protected directory. But when I plug in either of the user names and passwords I stored in .htpasswd, I get this message from my browser (after the little window that says, "Authorization failed. Retry?"):

    Authorization Required

    This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply
    the credentials required.

    Any ideas? Apparently the server can't find my .htpasswd file and/or access the passwords in it.??

    Any more suggestions? (I am making progress, thanks to you-all!)


    ------------------
    Parenting Adolescents
    ---Where parents & teens get expert answers for free.---


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •