Solved

htacess

Posted on 2006-07-09
20
247 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

16 Experts available now in Live!

Get 1:1 Help Now