Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 7 down vote accepted

The Listen directive in your config should be equal to Listen

share|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. – n0pe 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? – n0pe May 22 '11 at 1:26
you can do a netstat -nat | grep 80 and check whether port 80 is open on or or your ip address:80. For your case, it should be open only on – freethinker May 22 '11 at 1:32
thanks a bunch @freethinker – n0pe May 22 '11 at 1:32

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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