Solved

htacess

Posted on 2006-07-09
20
251 Views
Last Modified: 2010-03-04
im trying to use htaccess to secure a directory in apache.

the directory is:

C:\apache\htdocs\lisafinlay\cms

in that directory i have my .htaccess and .htpasswd files with the following content but i cant get it working?

AuthType Basic
AuthName "Secure Directory"
AuthUserFile .htpasswd
Require valid-user

in my httpd.conf file i have this too:

<Directory "W:/Apache/htdocs/lisafinlay/cms">
    AllowOverride All
    Options Indexes Includes
    Order allow,deny
    Allow from all
</Directory>

the error i get is:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

I get the login prompt appear...and i enter my username and password but get the above...

im not great with apache or htaccess so treat me nice if i dont understand you...

im running win xp pro sp2 with apache 2.2
0
Comment
Question by:ellandrd
  • 11
  • 6
  • 3
20 Comments
 
LVL 29

Accepted Solution

by:
TeRReF earned 290 total points
ID: 17070904
YOu need to create the .htpasswd in a certain way. The format is:
frances:WrU808BHQai36
john:iABCQFQs40E8M
lisa:FAdHN3W753sSU

You can find an online tool here to create the right entries for you:
http://www.4webhelp.net/us/password.php
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17070922
i have my htpasswd created:

seandelaney:oGGr2f6ISfGLI
lisafinlay:cuk9wgx16Ze0g

but i keep getting a server error.

i have tried all this online tools, but i think i keep getting my path wrong!

path of directory i want to protect is:

W:/Apache/htdocs/lisafinlay/cms/

path of directory where .htpasswd file is:

W:/Apache/htdocs/lisafinlay/private/

My .htaccess file is located in:

W:/Apache/htdocs/lisafinlay/cms/


 
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17070934
here is my .htaccess file:

AuthType Basic
AuthName "Secure Directory"
AuthUserFile /private/.htpasswd
Require valid-user
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 16

Author Comment

by:ellandrd
ID: 17071006
TeRReF

Can you help me please?  You have not replied...
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 17071069
Sorry, I have some work to do as well :)

Have a look in the server log, it tells you more about the cause of the error, post what you see and it will be easier to help you...

I don't know if it is a typo, but in your original question you use both C: and W:. Are you using both?

0
 
LVL 16

Author Comment

by:ellandrd
ID: 17071081
no im only using W:\ drive...  the C was a typo - sorry for the confusion...
0
 
LVL 29

Assisted Solution

by:TeRReF
TeRReF earned 290 total points
ID: 17071096
No prob, did you check your server log already?
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17071169
there was nothing to indicate what is causing it...
0
 
LVL 4

Assisted Solution

by:Tol_cv
Tol_cv earned 210 total points
ID: 17071569

for AuthUserFile  you should use the full path instead of /private/.htpasswd.
also if doesn;t work. try:
 Require user seandelaney lisafinlay , instead of Require valid-user
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17071588
when you say full path? im not sure about what is correct?

do you mean:

W:/Apache/htdocs/lisafinlay/private/.htpasswd ?
0
 
LVL 29

Assisted Solution

by:TeRReF
TeRReF earned 290 total points
ID: 17071637
Yep, that's what he means... by the way, isn't it:
W:\Apache\htdocs\lisafinlay\private\.htpasswd
under windows?
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17071708
i dunno? - i dont have any knowledge of apache...or htacess
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17071723
ok, now i get prompted to re-enter my username and password even after i enter them...  its not redirecting me to the secure page...
0
 
LVL 29

Assisted Solution

by:TeRReF
TeRReF earned 290 total points
ID: 17071737
Are you sure you use a valid username/passwd combination?
0
 
LVL 4

Assisted Solution

by:Tol_cv
Tol_cv earned 210 total points
ID: 17071764
are there an errors  in logs ? the page you get says  error 401  authentification required? if yes username or password is wrong....
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17071783
no i dont get any page as when i enter my username and password, the prompt appears again asking me to re-enter them.

if i click cancel i get authorisation required error...
0
 
LVL 4

Assisted Solution

by:Tol_cv
Tol_cv earned 210 total points
ID: 17071806
that means  bad username/passwd combination.
are you using  Require user seandelaney lisafinlay  of REquire valid-user ?
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17071845
ive tired both
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17071846
tried*
0
 
LVL 29

Assisted Solution

by:TeRReF
TeRReF earned 290 total points
ID: 17072008
Maybe you can try using some configuration program like this:
http://www.apache-gui.com/apache-windows.html
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question