Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

htacess

Posted on 2006-07-09
20
Medium Priority
?
257 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 1160 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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 1160 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 840 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 1160 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 1160 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 840 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 840 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 1160 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

971 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