LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 10-08-2003, 12:55 AM   #1
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Rep: Reputation: 15
Question About .htaccess & .htpasswd


Hi

I have created the .htaccess and .htpasswd in the path /usr/local/apache/cgi-bin/secure

I have checked both .htaccess and .htpasswd are located in the path but when I tried to access the secure directory by using the password I have created for .htpasswd, it does not accept it.

I have created the .htpasswd in plain text so to see that I have key in the correct password and still it does not allow me to access.

Here is what I did. For the httpd.conf:

Directory "/usr/local/apache/cgi-bin/secure">
deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow
</Directory>

-------------

For .htaccess and chown root .htaccess & chmod 644 .htaccess

AuthType Basic
AuthUserFile /usr/local/apache/cgi-bin/secure/.htpasswd
AuthName Secure
require valid-user
satisfy any

--------------

For .htpasswd and chmod 644 .htpasswd

htpasswd -bcp /usr/local/apache/cgi-bin/secure/.htpasswd admin secure

--------------
Restarted my apache with the command:

apachectl stop

apachectl start

After that, I tried to access the directory:
http://www.yourdomain.com/cgi-bin/secure/

and when it asks for User Name and password, I have keyed in:

User name: admin
Password: secure

after 3 attempts, it says Authorization Required without allowing me to login.

Any idea where I have gone wrong ?

Thanks!

Regards
Edward Han
 
Old 10-08-2003, 01:28 AM   #2
td_miles
Member
 
Registered: Sep 2003
Location: Australia
Distribution: RedHat
Posts: 51

Rep: Reputation: 15
I think you need to put:

Order deny,allow

in your .htaccess file as well. A copy of an .htaccess file that I know is working on my machine is:

=========================
AuthUserFile /var/www/passwd
AuthName "Router Statistics"
AuthType Basic
<Limit GET POST>
order deny,allow
deny from all
require user cfg
satisfy any
</Limit>
=========================
 
Old 10-08-2003, 05:14 AM   #3
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi miles

Following your example, it gives internal server error.

What else can I do ???

Regards
Edward Han
 
Old 10-17-2003, 12:16 AM   #4
Drogo
Member
 
Registered: Oct 2002
Distribution: RedHat 8 or 9 (shrike)- Fedora Core 1,2
Posts: 215

Rep: Reputation: 30
Try this


AuthUserFile /secure/.htpasswd
AuthName "Private Area"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>
 
  


Reply



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 .htpasswd plisken Linux - General 5 05-21-2006 01:44 PM
.htaccess .htpasswd issue Robin01 Linux - Newbie 4 12-24-2003 03:36 PM
.htaccess / .htpasswd inq Robin01 Linux - Newbie 1 12-20-2003 05:36 PM
Help with .htpasswd and .htaccess MikeeX Linux - General 3 03-25-2003 10:41 AM
Cannot see .htaccess and .htpasswd files John_Saunders Linux - Newbie 2 07-21-2002 09:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:55 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