1

Everyone can reach my website by putting my public IP address in the web browser. How can I stop this?

I am using Ubuntu 14.04 server and Apache 2.4

1
  • 2
    Why do you want that? What's the problem?
    – slhck
    May 24, 2014 at 8:46

1 Answer 1

5

Obviously you can't make Apache stop listening on this IP, but you can configure a new default vhost to display a blank page (or 403 or redirect or whatever) whenever a request over IP-only comes in. Actually, this is considered good practice.

Just add a new vhost definition, that will be read first by Apache, such as this:

<VirtualHost <your-ip>:80>
   DocumentRoot /var/www/blank
</VirtualHost>

and put an empty index.html into /var/www/blank. To get Apache to read the new vhost first, put it on top of the site-definition file that will be loaded first.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .