Solved

.htpasswd and Alias Directory

Posted on 2004-10-05
7
1,223 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
Comment Utility
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
Comment Utility
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
Comment Utility
no, now all is ok, both on the "internal" directory and the "external".

Daniele
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 15

Expert Comment

by:samri
Comment Utility
PAQ/refund ?
0
 
LVL 15

Expert Comment

by:periwinkle
Comment Utility
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
Comment Utility
Question answered by asker or dialog valuable.
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PHPmailer and exchange online(Office365) 3 224
PHP temp path missing 4 48
Php Remote Files 13 56
LINUX CENTOS + APACHE 9 31
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…
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 video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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