Question

Stop domains from being easily visible by IP address

  • Posted August 16, 2013

I followed this tut to get virtual hosts up and running on the default DO LAMP stack. So far, so good. https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts

When I visit my IP address in a browser, I see all the domains associated with the droplet. It’d be nice (and potentially more secure?) to have that data hidden away from public view. Is this possible, and what’s the best way to go about it?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@chemical.sweet - Care to expand on the potential security risk it could have? I’m following https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts which I assume has some kind of ‘best practise’ thinking behind it. <br> <br>@Kamal - Thanks for a useful answer.

You can either add an empty index.html file in /var/www or set apache’s virtualhost’s DocumentRoot to /var/www/default: <br> <br><pre>nano /etc/apache2/sites-enabled/000-default</pre> <br>Edit DocumentRoot and set it to /var/www/default. <br> <br>Create /var/www/default: <br><pre>mkdir /var/www/default</pre> <br> <br>Finally, create an empty file in it: <br><pre>touch /var/www/default/index.html<pre> <br> <br>Make sure you restart Apache.

You should not create domain root directories in /var/www <br>but should use more secure location. like <br> <br>/home/user/domains/domain1.com <br>/home/user/domains/domain2.com <br>/home/user/domains/domain3.com <br>