LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem With Htaccess (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-htaccess-754075/)

Arty Ziff 09-10-2009 01:40 AM

Problem With Htaccess
 
I would like to set up password protection on a directory, and I'm just not understanding what I'm not doing that would make it work correctly.

In the directory I want to protect, I have an .htaccess file:
Quote:

AuthName "UID and PWD Required."
AuthType Basic
AuthUserFile /home/mydomain/.htpasswd
AuthGroupFile /home/mydomain/.htgroup
require group member-users
require valid-user
The .htpasswd file was created with the htpasswd utility, and contains the user name / hash:
Quote:

Arty:queUavucIoz6I
And I've set up a group file, .htgroup:
Quote:

member-users: Arty
I understand I don't need the group if I don't want it...

Anyway, doesn't work, I can waltz on in to the directory without a PWD/UID.

Is there something I'm missing? Do I need to make changes to httpd.conf?

bathory 09-10-2009 02:10 AM

In httpd.conf you must use:
Code:

AllowOverride AuthConfig
for the directory you want to protect.

Arty Ziff 09-10-2009 07:14 PM

Quote:

Originally Posted by bathory (Post 3676917)
In httpd.conf you must use:
Code:

AllowOverride AuthConfig
for the directory you want to protect.

There is not way to contain this in the .htaccess file, not mod httpd.conf for every dir I want to protect?

chrism01 09-10-2009 08:56 PM

I'm pretty sure that's a global directive ie you only need to set it once in your httpd.conf file above the dir specific sections.
Check your httpd.conf file, it's probably already there, just commented out.


All times are GMT -5. The time now is 03:03 PM.