LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-01-2003, 01:40 PM   #1
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Rep: Reputation: 30
htaccess again


Do I have to edit httpd.conf in order to get htaccess to work ? Can smdy give me an example of a .htaccess file that I can put in a subdirectory and get it restricted from other users. Make it accesible only with password. THX
 
Old 11-01-2003, 01:45 PM   #2
tgflynn
Member
 
Registered: Oct 2003
Location: Rochester, New York (USA)
Distribution: Debian
Posts: 119

Rep: Reputation: 15
Re: htaccess again

Quote:
Originally posted by spank
Do I have to edit httpd.conf in order to get htaccess to work ?


It depends on what's in the httpd.conf file. htaccess configuration can be deactivated, limited, or the filename changed, all from httpd.conf. But on many default installs it will be set up to work out of the box.

Quote:
Can smdy give me an example of a .htaccess file that I can put in a subdirectory and get it restricted from other users. Make it accesible only with password. THX
Here's one:

AuthType Basic
AuthName "Whatever"
AuthUserFile /home/smdy/passwd
Require valid-user

Note that the file /home/smdy/passwd must be created with the htpasswd command. Also you should make sure that it's in a place that is not served by the Web server.

Tim
 
Old 11-02-2003, 03:50 AM   #3
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
Can you please tell me what directives form httpd.conf have to be edited in order to get .htaccess files to work ?
 
Old 11-02-2003, 08:48 AM   #4
tgflynn
Member
 
Registered: Oct 2003
Location: Rochester, New York (USA)
Distribution: Debian
Posts: 119

Rep: Reputation: 15
You first need the directive

AccessFileName .htaccess

directive for user access directories :

AllowOverride FileInfo AuthConfig Limit Options

You should look at the Apache documentation to see what these do and what other overrides can be allowed.

Finally, my configuration contains the following to prevent users from downloading the .htaccess files:


<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>



Tim
 
Old 11-02-2003, 09:56 AM   #5
bleah-man
Member
 
Registered: Nov 2002
Location: London UK
Distribution: RedHat 9
Posts: 58

Rep: Reputation: 15
Remember to:

chmod 755 your password and .htaccess file if you are running RH9 distro with apache 2.x - it's squirley on the permissions for some reason had me kicking myself for weeks on end!

Bleah-Man
 
  


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 Help GUIPenguin Linux - Security 6 02-22-2005 03:25 PM
.htaccess luca2005 Linux - Software 2 01-01-2005 08:38 PM
.htaccess kidestranged Linux - General 1 01-26-2004 11:18 AM
Htaccess DoobyWho Linux - General 4 04-28-2003 02:01 PM
.htaccess bretthoward Linux - Security 5 04-02-2001 04:33 PM

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

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