How to Disable Directory Listing Apache on Ubuntu Server
25 Sep 2020
If you have deleted the Apache default page on the Ubuntu server, but when you access the ubuntu server through a browser you get information like this:
This is because the directory listing feature of ubuntu is enabled by default when installing Apache. The reason this feature is activated by default is not known for certain, but if the feature is left active it will cause a problem on the security side. So, to harderning server security, this feature should be disabled in the following way:
- SSH to the server
- Type the command:
sudo a2dismod autoindex
- After that reload Apache using the command:
sudo service apache2 reload
That's it, try to access your server using a browser, it will appear like picture below, which indicates that the directory listing feature has been turned off.