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?
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?
/var/phpscripts could fit for you. There is no default, but it's mandatory that stays outside the public folder.
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.
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.
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.Another option is
/opt/$application/bin
, which is mostly inkeeping with FHS, but really my heart is with/usr/local/bin
.