I want to run a web application on my local OSX Lion machine. When I go to http://localhost:8080 there is already a process running so I get the following message:

Status Code: 404

Exception: Request URL / not found.<br><br>

Generated by Winstone Servlet Engine v0.9.10 at Wed Nov 30 13:01:15 CET 2011

How can I find the process that runs on this port under OSX. I found several entries that do the same on Linux but they do not seem to work in OSX.

Thanks a lot.

Update 1: I running the command lsof -i -P | grep 8080 results in the following output

WebProces 174 petersmith   20u  IPv6 0xffffff80147e6cc0      0t0  TCP localhost:50059->localhost:8080 (ESTABLISHED)

But this does not tell me which process is responsible for creating the html output that I get in my browser, when accessing the URL

Update 2: I should mention that I want to install Jenkins CI on my machine and there is already an installation present which seems to have a problem on my machine.

  • @slhck I did this and updated my answer, but it does not tell me which process is currently running. Curiously lsof -i tcp:8080 does not result in anything...
    – Besi
    Nov 30 '11 at 12:18
  • @slhck Seems you're reading my mind. Your link fixed my problem, if you post an Answer I'll happily accept it. Thanks!
    – Besi
    Nov 30 '11 at 13:02

In a very general way:

sudo lsof -i -P

… will list you all processes running on certain ports. See this answer for more details.

In your special case, Jenkins is already running. This Stack Overflow question has more information: Can not run Jenkins on Mac. The solution seems to be:

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

… which is also related to the similar Stack Overflow question: How to stop Jenkins installed on Mac Snow Leopard?

  • curiously lsof did not reveal that it was the Jenkins binary that was "occupying" port 8080
    – Besi
    Dec 2 '11 at 9:08
  • 1
    Ah, you know why? Because it's probably a system process and you need to run sudo lsof. My bad. Fixed the answer!
    – slhck
    Dec 2 '11 at 9:11
  • Correct, there we go: java 54 jenkins 135u IPv6 0xffffff8014817e80 0t0 TCP *:8080 (LISTEN)
    – Besi
    Dec 2 '11 at 12:25

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.