We have to use port 80 for our server. But when I was trying to use it in Mac, it always said that the 80 is used, but I don't know which program uses it.
I searched it in Google, and someone said it's about apache, but I tried, which is not working. I found this: https://gist.github.com/kujohn/7209628 , but seems it's not working visiting our server by IP address.
I really don't know what's going on and how can I find out which program using port 80 and stop it.
Many thanks if anyone can help, I'm new using Mac. Thanks.
Port numbers in the range from 0 to 1023 are classified as 'well-known' and port number 80 is reserved for HTTP. Typically you have servers listening on port 80 to handle HTTP requests.
Source: http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
To find out what process is using port 80
This will just kill the process, it will not stop a server instance that is already running from continuing to run.
It is not clear if you are using a database management system or not and which one but one method that has worked for me using MAMP is as follows.
sudo apachectl stop
command.I was having this issue, apache was disabled via launchctl, but was still tying up port 80 after launch, I could start up apache and it would work, but after unloading it, I couldn't start up anything on port 80. I was using the built in web server for Python as an easy test. It would work on port 81, but not on port 80.
sudo python -m SimpleHTTPServer 80
-- wouldn't worksudo python -m SimpleHTTPServer 81
-- would workHere are the symptoms:
The fix for me (after way too much searching) was simple:
sudo pfctl -F all
This flushed the packet filter, releasing port 80 (and others I assume 8080, 443, whatever ports apache might be tying up)
After that, and relaunching the python server, it came right up.
On Mac ports below 1024 can only be bound by the
root
user. Try launching your server asroot
user (withsudo
), or try to use a port above 1024.You can also try to add root permissions to your user in
/etc/sudoers
type the following in Terminal
you will get a list - e.g. dropbox listens on 80
you can copy the output to a text editor, etc to search
Might be Skype that is using port 80. If you have Skype installed and running try to change to a different port in the settings.