Solved

.htpasswd and Alias Directory

Posted on 2004-10-05
7
1,231 Views
Last Modified: 2008-03-06
I have to restrict the access of a directory using the .htaccess and .htpasswd files.
When I use it for a directory that is in the directory root all is fine, when I try to use it for a dierctory out of the root it dosen't work.

In the httpd.conf I use Alias /www/ "/databases/www/"

if I create a pippo.htm file I can see it.
Now I create the .htaccess file like the other way:

AuthName "Alpha_Web"
AuthType Basic
AuthUserFile /databases/www/.htpasswd
require valid-user

and the .htpasswd file:
pippo:68DnE1HvzmjoI

but no auth is required. I move this 2 file in another folders that is in the directory root chaning only the .htaccess pointer all works fine.

So how can I use the Apache .htpasswd restriction password system with a directory out of the directory root???

Thanks and sorry for my english
Daniele
0
Comment
Question by:giropizza
7 Comments
 

Author Comment

by:giropizza
ID: 12225250
I found it:
I have to use the httpd.conf:

    Alias /www/ "/databases/www/"

    <Directory "/databases/www/">
     Options Indexes
     AuthType Basic
     AuthName "Alpha_Web"
     AuthUserFile "/databases/www/.htpasswd"
     Require valid-user
     </Directory>

Bye bye
Daniele
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 12226136
Daniele -

FWIW, you probably didn't have Options AllowOverride for this directory prior to putting the auth information into the httpd.conf - that meant that you couldn't override the httpd.conf using an .htaccess file.
0
 

Author Comment

by:giropizza
ID: 12226193
no, now all is ok, both on the "internal" directory and the "external".

Daniele
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 15

Expert Comment

by:samri
ID: 12239847
PAQ/refund ?
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 12240438
Yes - it should be.  Daniele, as this isn't an abandoned question, you should post a question in Community Support:

http://www.experts-exchange.com/Community_Support/

requesting that the question is closed as PAQ/refund with a link to this question.

0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12278651
Question answered by asker or dialog valuable.
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

18 Experts available now in Live!

Get 1:1 Help Now