0

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?

joschi
  • 21,387
  • 3
  • 47
  • 50
H. Ferrence
  • 533
  • 3
  • 10
  • 18
  • Still interested in knowing if there are useful alternatives on the Allow from other than IP addresses. Thanks. – H. Ferrence Mar 09 '10 at 21:48

1 Answers1

0

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.

sumar
  • 2,106
  • 12
  • 12
  • Tried...no success...decided on another route (see http://stackoverflow.com/questions/2230391/php-shell-exec-and-sudo-must-be-setuid-root) – H. Ferrence Mar 09 '10 at 21:46