By default apache is configured to show following files instead of directory listing:
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
You can recursively list all these with this:
find /var/www -name 'index.*'
If your directory have any of those, apache will show it, instead of something like this:
To fix that, delete or rename index.* files to something else. Alternatively, you can change
DirectoryIndex directive and reload apache (
By default, apache
/var/www. Only files under that folder are displayed. Additionally, symlinks are followed only if destination is owned by same user. If you have files under
/var/www, you don't have to care about that.
Apache does not list files that
www-data user can not read. As long as there's
x the last group (marked with
^ below), everything is fine:
drwxrwxr-x 4 user group 4014 Feb 4 23:16 filename
Technically, you only need
x for folders. Your commands for changing the permissions were correct:
chmod -R 755 /var/www
If apache does not list any files even if you don't have any index files on your folder, use
tail -f /var/log/apache2/error.log
to see which errors apache encountered.