Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Still interested in knowing if there are useful alternatives on the Allow from other than IP addresses. Thanks. –  H. Ferrence Mar 9 '10 at 21:48

1 Answer 1

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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