LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2009, 02:40 AM   #1
Arty Ziff
Member
 
Registered: May 2008
Location: Tacoma, WA
Distribution: CentOS and RHEL
Posts: 102

Rep: Reputation: 15
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?
 
Old 09-10-2009, 03:10 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
In httpd.conf you must use:
Code:
AllowOverride AuthConfig
for the directory you want to protect.
 
Old 09-10-2009, 08:14 PM   #3
Arty Ziff
Member
 
Registered: May 2008
Location: Tacoma, WA
Distribution: CentOS and RHEL
Posts: 102

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
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?
 
Old 09-10-2009, 09:56 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with .htaccess thidranki Linux - Networking 3 01-27-2009 02:48 AM
.htaccess problem? Maje Programming 1 06-16-2006 03:38 AM
.htaccess problem lothario Linux - Software 0 01-22-2005 06:20 AM
.htaccess problem Ramon_E Linux - Security 3 10-20-2003 08:32 PM
.htaccess problem mwmethe Linux - Security 1 08-31-2002 01:32 PM


All times are GMT -5. The time now is 01:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration