Jump to content

Archived

This topic is now archived and is closed to further replies.

renaxgade

Password check http.conf?

Recommended Posts

Ok I was trying to set up a directory in which only I can access with my name and password. I have apache running on a windows xp machine, and the permissions for the directory im trying to make are only me (in windows). I created a new user and pass with htpasswd. Now in my httpd.conf file my directory thing looks like this:

<Directory /root/ />

Options FollowSymLinks

AllowOverride AuthConfig

AuthType Basic

AuthName \"Restricted Files\"

AuthUserFile C:Program FilesApache GroupApache2binpasswd.txt

Require user Joey

</Directory>

 

Now the folder I am trying to protect is under htdocs (the document root) root/. So the full path is C:Program FilesApache GroupApache2htdocsroot

 

The user i created with htpasswd is Joey. When I try to access the directory root I just get forbidden. Nothing else. No prompt. Am I doing anything wrong? :shock:

Share this post


Link to post
Share on other sites

try using / in your path instead of . i\'m always as to how the configuration paths work for windows... :shock: have you tried using the full path in the Directory directive? ...or not with the ending slash:

 

<Directory C:/Program Files/Apache Group/Apache2/htdocs/root>

Share this post


Link to post
Share on other sites

Ok i Got that part working, it now prompts me for a user name and password. But it gives me invalid password. I am 100% sure that is the name and password I created with htpasswd and i even tried creating another one. In the logs it says

[Fri Oct 17 15:53:05 2003] [error] [client 192.168.1.100] (OS 2)The system cannot find the file specified. : Could not open password file: C:/Program Files/Apache Group/Apache2/bin/password.exe

[Fri Oct 17 15:53:05 2003] [error] [client 192.168.1.100] user Renaxgade not found: /root/

 

Even though Im sure the password file is there. Should I make it .txt? The httpd.conf file looks like...

 

<Directory \"C:/Program Files/Apache Group/Apache2/htdocs/root\">

Options FollowSymLinks

AllowOverride AuthConfig

AuthType Basic

AuthName \"Restricted Files\"

AuthUserFile \"C:Program FilesApache GroupApache2binpassword.exe\"

Require user Renaxgade

 

There definetly is a file in bin callled password.exe that I created with htpassword.

Share this post


Link to post
Share on other sites

i\'m not sure how windows functions, but i\'m making the guess it functions as linux does (on this occasion at least...) on windows password.exe is the program that creates a password file. for example... tell password.exe to create a password file called \"passes.txt\" in /this/directory then set your apache config to look in /this/directory/passes.txt for the password info.

Share this post


Link to post
Share on other sites

Not wishing to be the bearer of bad news but ...

It is recommended that you install Apache Web server in a directory path with short directory names and no spaces.

Your present path includes spaces. Since Apache is really *nix code that has been tweaked to run on windows, it has a whole different idea as to how spaces should appear in a directory listing.

 

Alternatives:

* Reinstall apache to a different folder without spaces - pain in the butt, but pays off in the long run.

* change your paths to reflect the 8.3 names - easy quick fix, but now you have to do this for every script from now until forever!

 

Using the 8.3 syntax. your path would look something like:

C:/Progra~1/Apache~1/Apache2/bin/password.exe

 

You might want to use the DIR command with the /X parameter to get the long and short directory names so you can verify the actual number used after the tilde.

 

Hope that resolves your problem!

 

D

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.