22

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.

32

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

| improve this answer | |
  • 1
    Hey that's it! Thanks for the answer, I forgot I left that on. I just turned it off because I had forgotten to a while back when I was playing with settings. – Carter Pape Oct 3 '11 at 20:34
12

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
| improve this answer | |
  • 3
    Thanks, took way to log to figure that out for me. I had to google the exact HTML it was returning to find this comment. Also, interestingly running lsof -i :80 didn't show anything running on port 80 which threw me for a while. doing the stop command on apache fixed the issue. – Foovanadil May 18 '17 at 17:27
  • 1
    Actually to update that comment about lsof. It will show something but you need to SUDO the command to see things on port 80. If you don't it doesn't fail it just looks like nothing is running on that port. – Foovanadil May 18 '17 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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