Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-06-2007, 08:46 AM
|
#1
|
|
Member
Registered: Mar 2003
Location: Macondo
Distribution: Mandrake 9.1, 10.1, SuSE 8.1 pro, 10.1, Red Hat 8.0/9.0
Posts: 380
Rep:
|
.htaccess vrs <Directory>
In my Apache httpd.conf file I see this by default:
>>>>>>
# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>
# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
<<<<<<
Which is a great security measure BUT I am not sure what is the best way to override this (for my public html dir), without killing the initial intended functionality of protecting the rest of my file system.
In the Apache docs I see two options:
1) .htaccess
2) Or creating a <Directory> entry in my httpd.conf
I am not sure which one should I take?
Any ideas??!
|
|
|
|
01-06-2007, 10:42 AM
|
#2
|
|
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893
Rep:
|
Second, because first doesn't work with AllowOverrides None.
|
|
|
|
01-06-2007, 12:12 PM
|
#3
|
|
Member
Registered: Mar 2003
Location: Macondo
Distribution: Mandrake 9.1, 10.1, SuSE 8.1 pro, 10.1, Red Hat 8.0/9.0
Posts: 380
Original Poster
Rep:
|
OK, but how safe it?
Will it override this security entry:
>>>>>>
# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>
# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
<<<<<<
|
|
|
|
01-06-2007, 12:28 PM
|
#4
|
|
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893
Rep:
|
I do nothing special, and yet I get a 403 while trying to access .htaccess from 127.0.0.1 .
It will override - locally - settings for higher directory. And what do you understand under 'safe'? To have httpd entirely safe you need to shut it down... I guess it doesn't give .ht* files to anyone by default. But it will give HTML pages. It will also give results of running cgi scripts, but - if handlers are properly configured - not scripts themselves.
|
|
|
|
01-06-2007, 01:04 PM
|
#5
|
|
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
Apache only recommend using htaccess where you can't give access to the config file - for example, an ISP hosting sites will give clients htaccess abilities because you obviously can't let them edit httpd.conf
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:14 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|