php - 770 permissions on file in apache root, still viewable -


i've seen lot of questions on here regarding files not being accessible due permissions lamp nothing making files unviewable http client using permissions.

i have files , folders in apache2 root folder don't want people able access via browser or other external means. set permissions 770, doesn't seem enough. outside users access files apache user? i'm running lamp under ubuntu server little modifications defaults, apache user www-data, group :www-data, , apache root /var/www.

i have /var/www/_private folder has 770 permissions , same permissions on enclosed files. however, if access these files through browser, still viewable. clients accessing files www-data user? if so, how rectify this?

i've worked on hosted setups setting "other" permissions 0 sufficient denying outside direct access files. need install module gain functionality?

note: still need accessible-to-the-client php scripts access these files via includes, fopen, etc...

well, right, 770 means owner of file , group can read, write , execute it. i'm going guess apache owner of file, allowing access , open world.

instead of modifying permissions on server, , possibly causing harm accessibility of file, why don't use .htaccess file. instruct apache take actions in instances, denying access file. create .htaccess file in root of website

<files {your file name here}> deny </files> 

and you'll deny accessing apache.

and if want deny entire directory:

<directory /var/www/_private>    order deny,allow    deny </directory> 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -