I've installed a LAMP server locally and I want it to only be accessible from my own computer (not even my local network), only through loopback. Is this possible to do securely? If so, how?
2 Answers
The Listen
directive in your config should be equal to Listen 127.0.0.1:80
-
I looked at my /etc/apache2/httpd.conf (assuming this is the config file you mean) and I don't see any previous Listen commands. Am I in the wrong file? Pardon me for the noobness, first server setup.– nopcornMay 22, 2011 at 1:10
-
the apache config can be split into several files, depending on what distribution you are using. go to
/etc/apache2
and do agrep Listen * -r
. That will list the files with theListen
directive May 22, 2011 at 1:14 -
Conveniently located in Listen.conf! I've changed it and restarted the service. Is there a way to test this from my local machine? Without having to pick up another computer and trying?– nopcornMay 22, 2011 at 1:26
-
1you can do a
netstat -nat | grep 80
and check whether port 80 is open on127.0.0.1
or0.0.0.0
oryour ip address:80
. For your case, it should be open only on127.0.0.1
May 22, 2011 at 1:32