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?

link|improve this question

feedback

2 Answers

up vote 7 down vote accepted

The Listen directive in your config should be equal to Listen 127.0.0.1:80

link|improve this answer
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. – MaxMackie May 22 '11 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 a grep Listen * -r. That will list the files with the Listen directive – freethinker May 22 '11 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? – MaxMackie May 22 '11 at 1:26
1  
you can do a netstat -nat | grep 80 and check whether port 80 is open on 127.0.0.1 or 0.0.0.0 or your ip address:80. For your case, it should be open only on 127.0.0.1 – freethinker May 22 '11 at 1:32
thanks a bunch @freethinker – MaxMackie May 22 '11 at 1:32
feedback

Tell the server to only listen on 127.0.0.1 and ::1.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.