0

This might be a shot in the dark but I'll try anyway.

I require to run an app on localhost:80 but found that it was blocked. When going to localhost, I was greeted with this:

enter image description here

Clearly this was something I thought up when playing around with java servlets.

More to the point, when checking processes that are running on :80, I am only greeted with httpd processes. When looking at all my current active processes in ActivityMonitor, there is nothing that strikes me as unusual. I have also recursively searched for the text "It works!" throughout the machine and nothing pops up (I have also conducted other searches but found nothing). This servlet appears to be running at startup and have checked all startup menus that I am aware of and, again, nothing strikes me as out of place.

It seems like a process is running but the file that runs that process is gone, which I know is impossible.

My question is, is there a was to force terminate anything that is running on :80? (highly unlikely as I've mentioned that it doesn't appear in any processes). Also, is there somehow a more recursive search I can do? I have done the basic grep search and an SSD search in Finder but both turn up nothing...

1
  • What's your question; Your screenshot clealry shows localhost:80 isn't blocked. You have Apache installed. – Ramhound Jan 9 '17 at 5:57
2

As it already pointed, "It works!" is text from default web page for Apache web server installed on your system. You can verify it yourself by running: sudo lsof -n -iTCP:80 | grep LISTEN. Finder usually won't to show content of /etc folder, so you need to click on Go menu (when in Finder), and choose Go to Folder where manually enter /etc/apache2. There you can spot apache's configuration files where you can find web directory under "DocumentRoot" stanza then if you will go to that location, you will find index.html file that contain "It works!"

If running Apache instance prevent to run you servlet on port 80 (which is obviously conflict), then change default Apache's port 80 to something different, say port 8080 and restart Apache service from terminal; sudo /usr/sbin/apachectl restart

1
  • This is brilliant, thank you! I knew httpd was an Apache instance but whenever I tried to kill the process via terminal (sudo kill -9 <PID>), it would always just instantly restart – wmash Jan 9 '17 at 18:05
0

The following command would stop the apachectl running process and free the port 80.

   sudo /usr/sbin/apachectl stop

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.