I've just installed apache2 on my Ubuntu 14.04
My server is now accessible from anywhere if the right IP was provided. I want to disable that so that only users within my local network would be able to access the server.
I presume it has to be done from apache2.conf
P.S. I am sure this question has been asked before, but I think I lack the correct keywords to find a previous post :)
Maybe is better to enable firewall? UFW can allow access from host/network and deny for the rest of the world.
xxx.xxx.xxx.xxx
- represent your local network,zz
reprezent network maskYou can list rules with command
sudo ufw status
or
sudo ufw status numbered
I found it!
Scroll down till
<Directory /var/www/>
Add these two lines before
</Directory>
This will deny access from any IP except
127.0.0.1
, which is your own machine. If your network's IP is in the form of192.168.x.x
then allowing access from192.168.
will allow access to anyone in your network.