php - Where to store files on server so they are not accessible through a browser? -


when reading through questions , answers regarding maintaining security when allowing users upload files server, of answers said store file in location not accessible browser, , "above document root".

if had site running in 'var/www/' such as:

var/www/mysite/index.html

does "above document root" mean above mysite folder, still in var/www folder, or mean in seperate location var/www altogether, somewhere else entirely on server host's file system?

also, why making file innaccessible browser makes more secure? thanks.

i not worry moving files outside www folder, because if www folder vulnerable (whether through apache or other means) have number of other problems, , files accessible anyways. moving outside www folder has effect on portability of application, hosting companies not allow access beyond user www folder anyways.

enabling override in apache , placing .htaccess file following contents within folder want restricted recommended:

order deny,allow deny 

this way application self-contained , portable.

apache2.4 , php5.5 further hardened against issues involving access , execution of unwanted code on os level, recommend using latest versions of these packages possible.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -