LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 08-15-2007, 11:43 AM   #1
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Rep: Reputation: 30
Apache Restrict ALL access to file from web


Hey all,
I have some plain text files within one of my web directories. I need to access this file from a php script, so permissions must be:
-rw-r-r

But if i type in this file in my address bar, obviously the plain text file is seen.

Is there a way in Apache to restrict this, withOUT using .htaccess? .htaccess allows restricted access to files, I want to disallow ANYONE (myself included) from accessing this file via the WEB.

Thanks all very much!
 
Old 08-15-2007, 12:08 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Hi,

Does this text file need to be in the htdocs (web) directory tree?

If not: Why not put it outside the htdocs tree (= not readable by apache) and access it from there using your php script.

Hope this helps.
 
Old 08-15-2007, 02:08 PM   #3
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Original Poster
Rep: Reputation: 30
well, then it still wont be readable by "other" users, which is what i need to do, to allow "apache" users (as web users) to access the file.

Basically, i have a plain text password file.
But need to read this file (from php script, not web)

Thanks
 
  


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
Quick way to restrict access to Apache HTTPD introuble Debian 3 09-29-2006 03:15 AM
How can I restrict eth1 so only access is to Apache?? Tenox Linux - Networking 1 04-11-2005 02:32 PM
Apache and Outlook Web Access tsales314 Linux - Networking 3 02-23-2005 02:21 PM
Restrict web access using proxy in redhat 9 xeondavis Linux - Security 1 12-15-2003 03:51 PM
restrict file access loocw General 0 03-07-2001 12:37 AM


All times are GMT -5. The time now is 04:13 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration