Regarding htpasswd

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
J_Reynders
Forum Newbie
Posts: 3
Joined: Fri Jan 09, 2004 1:54 am
Location: Antwerp, Belgium

Regarding htpasswd

Post by J_Reynders »

After reading some of the posts here on security etc I dedided to start experimenting with htpasswd and .htaccess files. No problem in getting it to run on my (local) development machine. However when I try to get things going on my live server, none of the passwords (I just created so I'm pretty sure they're correct) are accepted.

Two questions:
- could my connection setup (cable internet > router/DHCP server > WiFi base station > server) have something to do with it ?
- I just FTP'd my test environment (including password and group files) to my live environment. The passwords are encrypted using the default htpasswd settings (so no plain text or extra encryption). Could it be that password checking is failing because the passwords were encrypted on a different system ?

Oh and one last (small) thing - does anyone know if there's an easier way to create a .htaccess file on a Windows system (my test environment) than having to copy con it? Explorer and most editors I've used just don't accept a filename starting with a period...

TIA
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Regarding htpasswd

Post by Weirdan »

J_Reynders wrote:Oh and one last (small) thing - does anyone know if there's an easier way to create a .htaccess file on a Windows system (my test environment) than having to copy con it? Explorer and most editors I've used just don't accept a filename starting with a period...
Editplus, for example, accepts such a filenames easily. Notepad also does (WinXP Pro SP1).
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

I have never had problem with a Wifi network and Apache.
J_Reynders
Forum Newbie
Posts: 3
Joined: Fri Jan 09, 2004 1:54 am
Location: Antwerp, Belgium

Post by J_Reynders »

.htaccess filename > probably my machine then ... thanks for replying...

[edit] And thanks for bringing Edit+ to my attention - nifty little editor 8)
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Re: Regarding htpasswd

Post by Nay »

Weirdan wrote: Editplus, for example, accepts such a filenames easily. Notepad also does (WinXP Pro SP1).
Though Notepad adds me the fustration of "Gaaahhhh" after seeing it's .htaccess.txt rather than .htaccess sometimes eh? O.o

-Nay
Black Unicorn
Forum Commoner
Posts: 48
Joined: Mon Jun 16, 2003 9:19 am
Location: United Kingdom

Windows and htaccess

Post by Black Unicorn »

Regarding the password encryption:

If you use Apache, the passwords may be encrypted using STD_DES or MD5. I think more recent versions of are using MD5 ... my Apache (version 1.3) uses STD_DES. It is recommended you use Apache's CLI to make a password. I have no problem using PHP to encrypt working passwords using crypt($password,CRYPT_STD_DES) and saving the result to some password file. On unix, anyway ...

If you want to save a .htaccess file using notepad or word, put it in quotes.
Just click Save As -> ".htaccess" and Windows won't bug you with illegal file names or add .txt extensions. I think this works on most Windows installations.
J_Reynders
Forum Newbie
Posts: 3
Joined: Fri Jan 09, 2004 1:54 am
Location: Antwerp, Belgium

Post by J_Reynders »

Reluctant to say this but boy am I an idiot ... I copied parts of the .htaccess file (the only file not copied from my test environment) and forgot to update the filepath for the groups and password files :oops: so it kept pointing to some other (existing) files (which of course did not include the user/pwd I just created) ...

Anyway thanks a bunch for the replies :D
Post Reply