-1

I have just hosted my website on Amazon AWS. It is working fine, but all files are publicly accessible.

like hitting url

mywebsite.com/uploads/ giving the list of all files.

mywebsite.com/php_code/ is giving the list of whole php codes.

How can I prevent this?

I have read this is something related to file permissions. but I am new to Ubuntu so can't get it.

1
  • This question shall be made to ask.ubuntu.com
    – JrBenito
    Jun 14, 2016 at 20:20

1 Answer 1

0

You could just stick a blank index.html file in each directory so that the default Apache behavior of listing files in a directory in the event of no index.html (or index.php) doesn't occur. You'll see that in CMS's like Wordpress.

You could also add Options -Indexes to your .htaccess file so that Apache won't list files in the directory.

In the end, this isn't an Ubuntu problem, it's not a file permission problem, it's not an AWS problem. It's actually an Apache problem, and it's doing what it's supposed to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.