~cs50/pset6/server public and ./server public in my own directory worked fine for a long time but now when I try to run it I get the message "Port 8080 already in use, stopping server."
How can I close port 8080?
Thanks!
As far as i can tell you can either use another port than 8080 or better stop the server using that port. The command for the latter is:
apache50 stop
This is somehow not written in the pset6 documentation, but in this video you can find the details by David: https://youtu.be/3dmp0ycKC5c
Hope that helps.
that means that some other process is already using the port (likely to be another instance of your server
). terminating/killing that process should make the port available to use.
if this process is not another instance of your server
, you probably should not do that and use some other port which is available. the command to kill a process using port 8080 from the command line is
sudo kill `sudo lsof -t -i:8080`
or
sudo kill $(sudo lsof -t -i:8080)