I want to button down write access on a particular file using the Allow form directive in my httpd.conf file.

I have a PHP script that I want to be the only resource that can write to this file.

Is there a variation of the Allow from that I can define to make this happen?

link|improve this question

44% accept rate
Still interested in knowing if there are useful alternatives on the Allow from other than IP addresses. Thanks. – Dr. DOT Mar 9 '10 at 21:48
feedback

1 Answer

Why not to put this file outside of DocumentRoot and give it proper privileges. If file is outside DocumentRoot, it can be still accessed through php script.

Of course you could use <Files> resoruce in Apache config, but for me it is not a proper solution, because file can be still undirectly accessed.

It should look like this:

<Files filename.ext>
    Order allow,deny
</Files>

Check the table in order directive.

link|improve this answer
Tried...no success...decided on another route (see stackoverflow.com/questions/2230391/…) – Dr. DOT Mar 9 '10 at 21:46
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.