3

I want to move my php scripts out of the /var/www so that they are not accessible via a URL. But where is the most logical place to store these?

5 Answers 5

4

/var/phpscripts could fit for you. There is no default, but it's mandatory that stays outside the public folder.

2

Any option might be good one, i for example like the /home/%user% path, it's outside the reach of the web (depends on where i've pointed apache to look). you can also keep it on /var/www but chmod it so no one can access it outside.

2

I like /usr/local/[something], ie /usr/local/cron/ or /usr/local/bin/ which is what $work rolls with. Other than that using the $HOME directory of the user the script will run as is a good place to put it. $HOME/bin/ or $HOME/cron/ are solid options.

The "most logical place" is really up to you.

2
  • +1 for /usr/local/bin Dec 27, 2012 at 23:05
  • @TomO'Connor if only there were a place for a us e r to put their local scripts and bin aries...
    – Sammitch
    Dec 27, 2012 at 23:11
0

I prefer using a bin directory under the $HOME directory of the user invoking the cron job. If you're invoking as the httpd user, you could still do that, but add an .htaccess file to the bin directory to prevent access via the web server.

0

Another option is /opt/$application/bin, which is mostly inkeeping with FHS, but really my heart is with /usr/local/bin.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .