views:

23

answers:

2

This is the path of folder where are my web documents and which I want to protect: "C:\Program Files\PostgreSQL\EnterpriseDB-ApachePhp/apache/www/MyWeb"

Also in this folder I placed: .htaccess and .htpasswd

My .htaccess has following: AuthName "Protected site" AuthType Basic AuthUserFile C:\Program Files\PostgreSQL\EnterpriseDB-ApachePhp/apache/www/MyWeb/.htpasswd require valid-user

In httpd.conf for DocumentRoot "C:\Program Files\PostgreSQL\EnterpriseDB-ApachePhp/apache/www" I changed AllowOverrid None to All and added row AccessFileName .htaccess as below: AccessfileName .htaccess

Options FollowSymLinks AllowOverride None ----> All Order deny,allow Deny from all

So this is what I have done exactly!

And sorry for question I asked one more time, becuase It seems to me that people answere on question only in first tem minutes, after that it falls in oblivion. :)

A: 

Make sure that the file is called .htaccess, your path says it is .htpasswd.

And you need to have htaccess handling enabled in your apache config. I think this is needed: AllowOverride AuthConfig

Anders Westrup
.htaccess and .htpasswd are in the same folder:C:\Program Files\PostgreSQL\EnterpriseDB-ApachePhp\apache\www\ProtectedFolder.htaccess----------AuthName "Pod zastitom"AuthType BasicAuthUserFile C:\Program Files\PostgreSQL\EnterpriseDB-ApachePhp\apache\www\ProtectedFolder\.htpasswdAnd in .htpasswd is user and passwd!!!But It does not work!!! Can you tell me one more time what should I do with that AllowOverride and AuthConfig and where is that?require valid-user
Z77
@Z77 AllowOverride is in `httpd.conf` file. Also check the `AccessFileName` setting, it should be set to `.htaccess`.
Pekka
I appreciate your help. Let me check it and try. I will be back here in few minutes.
Z77
According to this path C:\Program Files\PostgreSQL\EnterpriseDB-ApachePhp\apache\www I changed AllowOverride None to AllowOverride All in httpd.conf.But It still does not work. Should I change anything else within httpd.conf?!?!!?Please.
Z77
And where can I chanage this AccessFileName settings?!?! Should I write this in .htaccess or where?
Z77
A: 

After few days I finally found out what was wrong with my settings. First, I did huge mistake not to restart apache after every change I've done (AllowOverride All). So have in your mind to do this If you rewrite something in your httpd.conf...And second thing I've not seen that it is wrong: is path in my .htaccess file where It should be written with " ". Because "Program Files" has space in the name between words.

I hope my tips will be useful for someone with same problem maybe doing exactly same things wrong.

Z77