LinuxQuestions.org
Visit Jeremy's Blog.
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 12-15-2005, 10:38 PM   #1
kuplo
Member
 
Registered: Oct 2005
Posts: 123

Rep: Reputation: 15
htaccess


What do I have to put in an .htaccess file and .htpasswd file so that it asks me for my username and password to access a directory?

I know it's got to be something simple, but the more I looked at apache.org the more I got turned around clicking on different links for directives and what not.

Can someone tell me what it is I have to do to make that work. And if in my .conf file for the virtual host I have
Code:
<Directory "/srv/blah blah blah - path to the virtual hosts root directory>
Options None
Allowoverride None
Order allow,deny
Allow from all
</Directory>
Will it negate any htaccess file because of the Allowoverride None in the yast.conf file that holds my virtual hosts?

Thank you for your help, I want to password protect the clients log and webalizer files as well as be able to put it in my faqs for future clients.

Much appreciated.

Last edited by kuplo; 12-15-2005 at 10:40 PM.
 
Old 12-16-2005, 02:12 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
First you have to change Allowoverride to AuthConfig
Then create a .htaccess file in the directory you want to protect, with something lke this:
Code:
AuthName      "Protected Area"
AuthType        Basic
AuthUserFile   /path/to/htpasswd
require user     username
And use htpasswd to create a password for the user "username"
 
Old 12-16-2005, 02:39 AM   #3
kuplo
Member
 
Registered: Oct 2005
Posts: 123

Original Poster
Rep: Reputation: 15
So you have to create a new <directory> </directory> file for every folder I want to password protect for each virtual host that wants to password protect one or more of their directories. Man, this is really turning out to be some work lately.
 
Old 12-16-2005, 04:33 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can do this, or you can change the Allowoveride for the whole DocumentRoot which then makes apache a little slower because for every request to different directories it has to search if there is a .htaccess file
 
Old 12-16-2005, 05:42 AM   #5
kuplo
Member
 
Registered: Oct 2005
Posts: 123

Original Poster
Rep: Reputation: 15
I dont think my servers apache was configured with this ability because when I replaced Allowoverride None with AuthConfig then restarted apache and it said that line was no good. Im gonna start looking for a specialist in my area that makes home/office calls, and get him to install the mail server proerly so that clients can get their email, right now they can send out, but not receive anything, and take care of the little things like this I'll watch over him like a hawk with notebook in hand taking full notes of what he's doing in case I have to do it again. Im getting it (the information from books and forums, but things are moving way too slow), I need a fully running server with webmin or some inexpensive control panel lastweek so I can start hitting up th esmall business's in my area and get their business.

Thanks for the try,

P.S. It's SuSE 9.3 PRO.
 
  


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 kidestranged Linux - General 1 01-26-2004 10:18 AM
htaccess xlord Linux - Newbie 1 01-16-2004 09:20 PM
About .htaccess... raymond Linux - General 4 07-02-2003 12:21 PM
Htaccess DoobyWho Linux - General 4 04-28-2003 01:01 PM
.htaccess raek Linux - Newbie 1 08-17-2002 11:53 PM

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

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