To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > Windows Help

Windows Help Help with the Windows operating system

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-25-2000, 02:07 AM   #1
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
Using a .htpassword file in a windows installation

I installed apache over windows, and I am trying to use a .htaccess file to password protect a directory. I create my .htpasswd file with the username and the crypted password and I have an .htaccess file like this:

allow from all
AuthType Basic
AuthUserFile c:/home/myweb/cgi-bin/.htpasswd
require valid-user

When I point my browser at http://localhost/ it asks me for the username and password, but it won't accept it. I keep getting an access denied page.

I have tested the same .htpasswd file in an apache server over Linux an it works, what could be the problem with windows?
Anon is offline   Reply With Quote
Old 07-27-2000, 07:14 AM   #2
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Using a .htpassword file in a windows installa

A ".htpasswd"-file created on Linux will NEVER WORK IN WINDOWS!!!
The reason is obvious: there's not the same encryption type. Windows uses MD5 and Linx something else.
Try again! You might have luck this time!

Chris
Anon is offline   Reply With Quote
Old 07-28-2000, 02:51 PM   #3
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Using a .htpassword file in a windows installa

I tried again using the htpasswd.exe included in the apache distribution, worked like a charm now!! thanks a lot.
Anon is offline   Reply With Quote
Old 07-28-2000, 04:18 PM   #4
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Using a .htpassword file in a windows installa

you're welcome. I'm glad to hear that.
good luck!
Chris
Anon is offline   Reply With Quote
Old 08-08-2000, 01:01 AM   #5
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Using a .htpassword file in a windows installa

hi, ken

i have installed php3,apache in Window98 and i am looking for the solution same as u( since u have succeed to do it, pls teach me..! thank )

i have created a .htpasswd file by using htpasswd.exe and i stored the file in:
C:\Program Files\Apache Group\Apache\users\.htpasswd

i also have created a .htaccess file and put it into one of the directory in document root..

but i still can access into the directory without any login!
Please..help me !
Thank you very much!

cK
Anon is offline   Reply With Quote
Old 08-08-2000, 08:39 AM   #6
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Using a .htpassword file in a windows installa

The .htaccess file need to be in the directory that is password protected. The .htpassword can be anywhere, but you must point to it from the htpasswd

My document root is
c:\www\web\htdocs

In a directory named "private" I placed the .htaccess file, then whenever I want to access that directory it asks me for the username and password. The contents of the htaccess file I have is

allow from all
AuthType Basic
AuthUserFile d:/www/web/htdocs/private/.htpasswd
AuthName "Private area"
require valid-user

and I have the .htpasswd file in the same directory. Hope this example helps.
Anon is offline   Reply With Quote
Old 03-21-2001, 08:57 AM   #7
fotakis
Junior Member
 
Join Date: Jan 2001
Posts: 13
RE: Using a .htpassword file in a windows installa

I know this is really stupid, but when I try to create any file beginning with a ".", it does not accept it under windows.

For example I cannot create an ".htaccess" file!!

Also how do you load that password module?


Any help will be very much apreciated.

Thank you very much in advance,
Fotis
fotakis is offline   Reply With Quote
Old 02-11-2002, 08:47 PM   #8
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Using a .htpassword file in a windows installa

To create a .htaccess or .password file in Windows, make a file called something like "htaccess" and drop to MS-DOS and rename it, e.g. REN htaccess .htaccess

Works a treat.
Anon is offline   Reply With Quote
Old 08-29-2002, 08:35 PM   #9
ikellen
Junior Member
 
Join Date: Aug 2002
Posts: 1
OK I have been screwing with this same thing for days, and I can't get it to work. A friend of mine said you have to modify something in http.conf for apache to comprehend .htaccess on Windows. Any ideas?
ikellen is offline   Reply With Quote
Old 08-30-2002, 05:51 AM   #10
piersk
Moderator
 
Join Date: Aug 2002
Location: Guildford, UK
Posts: 4,279
If you put AllowOverride All into the <Directory></Directory> bit in your httpd.conf file, then apache will see the .htaccess file.

Chris: This will work with windows as well as linux.
piersk is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 06:25 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.