ellandrd
asked on
htaccess not working
i want to protect this directory:
w:/apache/domain/htdocs/pr elease
so ive placed the following .htaccess and .htpasswd files in:
w:/apache/domain/htdocs/pr elease/.ht access
w:/apache/domain/htdocs/pr elease/.ht passwd
In my .htaccess file i have this:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile w:/apache/domain/htdocs/pr elease/.ht passwd
AuthGroupFile /dev/null
require valid-user
btw, the w:/apache/domain/htdocs is a virtual host
Do i have to modify/add anything to my httpd.conf file?
w:/apache/domain/htdocs/pr
so ive placed the following .htaccess and .htpasswd files in:
w:/apache/domain/htdocs/pr
w:/apache/domain/htdocs/pr
In my .htaccess file i have this:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile w:/apache/domain/htdocs/pr
AuthGroupFile /dev/null
require valid-user
btw, the w:/apache/domain/htdocs is a virtual host
Do i have to modify/add anything to my httpd.conf file?
ASKER
ok but currently i have this setup:
<Directory w:/apache/domain/htdocs>
Order deny,allow
Allow from All
Options Indexes
</Directory>
do i need this:
<Directory w:/apache/domain/htdocs/pr elease>
AllowOverride +AuthConfig
</Directory>
too?? as i only want to protect the prelease directory inside htdocs of w:/apache/domain
<Directory w:/apache/domain/htdocs>
Order deny,allow
Allow from All
Options Indexes
</Directory>
do i need this:
<Directory w:/apache/domain/htdocs/pr
AllowOverride +AuthConfig
</Directory>
too?? as i only want to protect the prelease directory inside htdocs of w:/apache/domain
Change current to
<Directory w:/apache/domain/htdocs>
Order deny,allow
Allow from All
Options Indexes AuthConfig # every .htaccess in w:/apache/domain/htdocs and subdirs may change AuthConfig
</Directory>
or add the new code - but after the above (order of <directory> declarations have meaning), so only Directory w:/apache/domain/htdocs/pr elease is allowed to use AuthConfig in it's .htaccess
Hope i'm clear.
<Directory w:/apache/domain/htdocs>
Order deny,allow
Allow from All
Options Indexes AuthConfig # every .htaccess in w:/apache/domain/htdocs and subdirs may change AuthConfig
</Directory>
or add the new code - but after the above (order of <directory> declarations have meaning), so only Directory w:/apache/domain/htdocs/pr
Hope i'm clear.
ASKER
>>Hope i'm clear.
no - sorry
like this:
<Directory w:/apache/domain/htdocs>
Order deny,allow
Allow from All
</Directory>
<Directory w:/apache/domain/htdocs/pr elease>
Order deny,allow
Allow from All
Options Indexes AuthConfig
</Directory>
no - sorry
like this:
<Directory w:/apache/domain/htdocs>
Order deny,allow
Allow from All
</Directory>
<Directory w:/apache/domain/htdocs/pr
Order deny,allow
Allow from All
Options Indexes AuthConfig
</Directory>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok.
and the path in my .htaccess file is correct right?
AuthName "Restricted Area"
AuthType Basic
AuthUserFile w:/apache/domain/htdocs/pr elease/.ht passwd
AuthGroupFile /dev/null
require valid-user
and the path in my .htaccess file is correct right?
AuthName "Restricted Area"
AuthType Basic
AuthUserFile w:/apache/domain/htdocs/pr
AuthGroupFile /dev/null
require valid-user
Yes
> AuthGroupFile /dev/null
is it working under windows ?
> AuthGroupFile /dev/null
is it working under windows ?
ASKER
ok i added what you said and removed the AuthGroupFile and now apache failed to restart...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
nope - apache still wont start for me again
ASKER
it is this:
<Directory w:/apache/domain/htdocs/pr elease>
AuthConfig
Options +AuthConfig
</Directory>
and not this:
<Directory w:/apache/domain/htdocs/pr elease>
Options +AuthConfig
</Directory>
right? your # comments are overlapping and confusing me to what is inside the directory and what is not!
<Directory w:/apache/domain/htdocs/pr
AuthConfig
Options +AuthConfig
</Directory>
and not this:
<Directory w:/apache/domain/htdocs/pr
Options +AuthConfig
</Directory>
right? your # comments are overlapping and confusing me to what is inside the directory and what is not!
The second one - literally as I provided.
> nope - apache still wont start for me again
and what is the error message?
and what is the error message?
ASKER
MMmm ok i added this:
<Directory w:/apache/sdwebdesign/htdo cs/preleas e>
AllowOverride AuthConfig
</Directory>
and i got prompted for username and password and after i entered them i got page not found??
but inside the prelease directory, is index.php so shouldnt it just pick that up?
<Directory w:/apache/sdwebdesign/htdo
AllowOverride AuthConfig
</Directory>
and i got prompted for username and password and after i entered them i got page not found??
but inside the prelease directory, is index.php so shouldnt it just pick that up?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
now after i enter my password and username i get:
"Server Error" from my custom error pages...
"Server Error" from my custom error pages...
ASKER
my error logs show:
[Fri Sep 22 14:28:54 2006] [error] [client 127.0.0.2] (OS 3)The system cannot find the path specified. : Could not open password file: W:/Apache/domain/htdocs/pr elease/.ht passwd
[Fri Sep 22 14:28:54 2006] [error] [client 127.0.0.2] (OS 3)The system cannot find the path specified. : Could not open password file: W:/Apache/domain/htdocs/pr
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
my path was wrong inside my .htaccess file, but now it keeps promtping me for user/password combo... and when i type it in, it wont accept them...
ASKER
im getting:
[Fri Sep 22 14:46:12 2006] [error] [client 127.0.0.2] user seandelaney: authentication failure for "/prelease": Password Mismatch
i used dynamic drive to create my username and password? would that site have created it wrong? where or how can i create my hashed password that will "work"...
[Fri Sep 22 14:46:12 2006] [error] [client 127.0.0.2] user seandelaney: authentication failure for "/prelease": Password Mismatch
i used dynamic drive to create my username and password? would that site have created it wrong? where or how can i create my hashed password that will "work"...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ive just copied and pasted it in
ASKER
the 'htpasswd' utility worked great!!
Depends - and for that You have to look into apache's errorlog
To use any directive in .htaccess You have to be allowed to Override the value it changes. eg.
to use AuthName You have to be allowed to override AuthConfig, therefore in httpd.conf You need
<Directory w:/apache/domain/htdocs/pr
AllowOverride +AuthConfig
</Directory>
Refer http://httpd.apache.org/docs/2.0/mod/core.html#authname