-1
I have a Debian server and the directory to put projects in apache is the traditional /var/www/html, I’m trying to block browsing directories and sub-directories through the browser with . htaccess but I’m not getting it right.
The . htaccess code is in the html folder with permission 644 www-data user:
<Directory /var/www/html>
AllowOverride All
Options -Indexes
</Directory>
I tried both ways but it didn’t work, will have to restart apache ?
– user2831852
Although it may not only be that, but yes, it has to restart the apahe.
$ sudo /etc/init.d/apache2 restart
– Sidon
I tried both examples and always restarting apache and did not give, continue listing... I want apache to stop listing folders because yesterday I saw in apache logs that someone was kicking some directories on my server. If you need the apache version: Server version: Apache/2.4.10 (Debian)
– user2831852
What do you mean someone was kicking directories? in what way?
– Sidon
I created a free account in google cloud, then created a vm with LAMP to do some tests, this VM has a variable IP for internet access and that only I know, from taking a look at apache logs to see something else I saw that they had error logs because they tried to access several different addresses like /html/login, /password, /PASSWOR, /robot.txt ... and so on, so I want to take away at least the browsing of Apache files/folders! (I think the racy pyjamas keep kicking address rsrs)
– user2831852
I edited the answer, try applying the specified configuration in apache.
– Sidon
Good! It worked! Thank you very much!
– user2831852