LinuxQuestions.org
Register a domain and help support LQ
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 03-11-2013, 06:29 AM   #1
jitendra.sharma
Member
 
Registered: Mar 2013
Location: ahmedabad
Distribution: CentOS, Ubuntu, Debian
Posts: 92
Blog Entries: 1

Rep: Reputation: Disabled
htaccess not prompting for password


after installation of mod_ssl packages htaccess not prompting for password..
i have made two files
htaccess and htpasswd on apropriate location
and i have also done
AllowOverride Authconfig in httpd.conf.........
thanks in advance
 
Old 03-11-2013, 06:41 AM   #2
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Have you checked the path of .htpasswd file in .htaccess.
These should be contents of both files.
.htaccess
Code:
AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile /path/to/.htpasswd 
AuthGroupFile /dev/null 
require valid-user
.htpasswd
Code:
username:encrypted password
 
Old 03-11-2013, 06:46 AM   #3
jitendra.sharma
Member
 
Registered: Mar 2013
Location: ahmedabad
Distribution: CentOS, Ubuntu, Debian
Posts: 92
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
as per your reply my configuration is same to you but i still didn't get the prompt for password and it is opening as normel directory.
 
Old 03-11-2013, 06:55 AM   #4
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
If you have put the password once and now you are trying to refresh the page to see the login box, it does not work.
You have to close the browser then open your url again, it will ask for password.
 
Old 03-11-2013, 07:19 AM   #5
jitendra.sharma
Member
 
Registered: Mar 2013
Location: ahmedabad
Distribution: CentOS, Ubuntu, Debian
Posts: 92
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
its not happening....
Actuly its was working before the ssl.conf install (mod_ssl) and prompting fot the password Now it is redirecting to directory without password prompt.
i have try with new one directory.........
 
Old 03-11-2013, 08:32 AM   #6
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
As you have said you added AllowOverride Authconfig in httpd.conf
Try this once.
Add following code in your httpd.conf
Code:
<Directory /path/of/your/project>
AllowOverride All
</Directory>
Restart apache.
 
Old 03-11-2013, 12:02 PM   #7
jitendra.sharma
Member
 
Registered: Mar 2013
Location: ahmedabad
Distribution: CentOS, Ubuntu, Debian
Posts: 92
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
i think my configuration is perfect as you all mantioned above but i still have problem............if anybody have best suitable tutorial for CentOS 5.4 please share with me...
 
Old 03-11-2013, 10:55 PM   #8
jitendra.sharma
Member
 
Registered: Mar 2013
Location: ahmedabad
Distribution: CentOS, Ubuntu, Debian
Posts: 92
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
My problem solved Thanks to all guys thnk u so much for coopration.......
Actuly i moved my .htaccess to /var/www/html/ (Directory location) and httpd got the .htaccess file and prompting for password .........................thnks again.
 
Old 03-12-2013, 10:10 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
FYI, having the file in the DocumentRoot is a bit risky. Recommended best practice is to put the htaccess directives into the relevant httpd.conf <Directory>...</Directory> stanza instead.
Also, faster as Apache has to re-read the .htaccess file each time its accessed.
 
1 members found this post helpful.
Old 03-26-2013, 09:49 AM   #10
jitendra.sharma
Member
 
Registered: Mar 2013
Location: ahmedabad
Distribution: CentOS, Ubuntu, Debian
Posts: 92
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
chrism01 thanks a lot dear.
 
  


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
prompting for root password suresh.j Linux - Kernel 7 09-18-2010 12:24 PM
ssh prompting password maooah Linux - Enterprise 4 12-05-2007 09:42 AM
Ssh without prompting for a password deqmacrom Linux - General 2 04-21-2005 03:13 AM
Prompting for a password with pppoe fcnewbie Mandriva 0 06-15-2004 02:36 PM
frequent password prompting jwhiz Linux - Newbie 3 12-27-2003 06:03 PM


All times are GMT -5. The time now is 11:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration