You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Thorburn <im...@nwconx.net> on 2003/01/21 03:27:03 UTC

[users@httpd] Apache 1.3.20 and .htpasswd

Hi,

I'm having some difficulties with a hosting company I've been stuck 
with.  I have a site designed using PHP/MySQL and am now trying to put a 
password on one of the directories.  Normally I do this using PHP and 
Sessions, but for some unknown reason it's just not working and my client 
is becoming increasingly bitter about this.

Awhile back I remember reading that Apache can create it's own password 
protected directories using the htpasswd command.  Since I don't have shell 
access to my hosting companies server, I tried this on a local test machine 
- here is what I typed:

htpasswd -c /home/sites/site140/web/mcx/.htpasswd username

(I found the path by using phpinfo();)
I was then prompted to enter a password which I did.  I then uploaded the 
.htaccess file to my host - yet it still does not work.  Do I need to 
change any permissions on this file in order for it to become active?

Any help on this matter would be greatly appreciated.

If it helps, here's a list of the mod's their version of Apache was 
compiled with:
mod_casp2, mod_ssl, mod_php4, mod_setenvif, mod_unique_id, mod_auth, 
mod_auth_pam_external, mod_access, mod_rewrite, mod_alias, mod_userdir, 
mod_actions, mod_imap, mod_asis, mod_cgi, mod_frontpage, mod_dir, 
mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, 
mod_log_config, mod_define, mod_env, mod_perl, mod_so, http_core


Thanks
-Tim



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 1.3.20 and .htpasswd

Posted by Jacob Coby <jc...@listingbook.com>.
> I'm having some difficulties with a hosting company I've been stuck
> with.  I have a site designed using PHP/MySQL and am now trying to put a
> password on one of the directories.  Normally I do this using PHP and
> Sessions, but for some unknown reason it's just not working and my client
> is becoming increasingly bitter about this.

You also need to put a .htaccess file in the directory you want to password
protect.  It should say something along the lines of:

--
AuthName "Your Description Here"
AuthType Basic
AuthUserFile /home/sites/site140/web/mcx/.htpasswd
require valid-user
--

-Jacob


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org