Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

.htpasswd and Alias Directory

Posted on 2004-10-05
7
1,250 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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