Solved

htacess

Posted on 2006-07-09
20
248 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
 
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now