Why is "It works!" showing up at my http://127.0.0.1 (localhost)?

So, I was playing around with Java sockets, servers and streams, the other day, and I decided, purely out of curiosity, expecting no good results, to open Google Chrome and navigate to 127.0.0.1, and lo and behold, I come across an actual page! The page source is <html><body><h1>It works!</h1></body></html>

I got hit with an epiphany that I could easily start playing around with HTML and possibly create my own website if I could find what was causing this page to come up, and where on my computer the page is located. I was searching for a possible installation that I might have made that would make my iMac (and Macbook; this thing happened on the iMac AND Macbook) act this way. So far, I've come up with the possibility of it being Eclipse EE, XCode, BBEdit, MonoDevelop (unlikely), LabView (also unlikely) or a few other programs. Those are the only developer programs I have installed that might have this effect. I don't have Apache.

Any help would be greatly appreciated.


This is default behavior in OSX when you enable the web server in the properties. You can find it in this control pane: enter image description here


Newer versions of macOS might not have the option displayed in the Sharing panel, as is shown in Bart De Vos's answer. In that case, running this command from Terminal should stop it:

sudo apachectl stop

Based on my own experience, it shouldn't start up automatically after that, even after a system restart.

Or, if you want to start it manually:

sudo apachectl start