LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-28-2008, 09:16 PM   #1
thinice15
Member
 
Registered: Feb 2008
Distribution: Slackware 12.0
Posts: 37

Rep: Reputation: 15
.htaccess help


I have tried a million times to get this to work i dont understand i have the ".htaccess" file in the directory that i want to be password protected and i have the ".htpasswd" file in the directory that i want to be password protected and when i go to the url that i want to be protected it just lets me in theres no popup that asks for a username and password just lets me in but heres the two files:

Heres ".htaccess"
Code:
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /var/www/htdocs/downloads/.htpasswd
AuthGroupFile /dev/null
Require valid-user
and Heres ".htpasswd"
Code:
john:qq7NGfoDRRYUY
please help me out here.
 
Old 11-28-2008, 09:28 PM   #2
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
In your httpd.conf, look for an "AllowOverride" setting within the directory container. It might look something like this:

Code:
<Directory "/var/www/htdocs">
	...
	AllowOverride None
	...
</Directory>
You'll need to change "None" to "AuthConfig", e.g.:

Code:
<Directory "/var/www/htdocs">
	...
	AllowOverride AuthConfig
	...
</Directory>
The "AllowOverride" setting specifies which things are allowed, in .htaccess files, to override the settings in httpd.conf. There are various possible options. But you must include "AuthConfig", or set AllowOverride to "All", to enable password-protecting directories via .htaccess.

Remember to re-start Apache after editing httpd.conf.

Last edited by sleddog; 11-28-2008 at 09:29 PM.
 
Old 11-28-2008, 09:29 PM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Have you set AllowOverride for this directory? See http://httpd.apache.org/docs/2.2/howto/htaccess.html
 
Old 11-28-2008, 09:50 PM   #4
thinice15
Member
 
Registered: Feb 2008
Distribution: Slackware 12.0
Posts: 37

Original Poster
Rep: Reputation: 15
thanks guys i got it to work.
 
  


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
.htaccess ralide Linux - Software 3 06-18-2005 11:15 AM
.htaccess luca2005 Linux - Software 2 01-01-2005 07:38 PM
.htaccess Lionheart008 Linux - Newbie 1 10-15-2004 02:15 PM
.htaccess tailine Linux - Newbie 27 06-16-2003 07:27 AM
.htaccess raek Linux - Newbie 1 08-17-2002 11:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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
Open Source Consulting | Domain Registration