So the error says that the address is already in use. I have configured the /etc/hosts
with some DNS mapping to a few domains. Not sure if this is causing the problem.
2 Answers
Please read this carefully.
Perform the following command, and if you see it is apache, then do the following below the command.
Note: You need to install the net-tools package before you could run netstat. Run sudo apt install net-tools
to install it.
sudo netstat -antup | grep 80
You should check the line with something like <Your IP>:80
I don't think it is associated with /etc/hosts at all, as it is just a file which manages the DNS of local domains like your computer name. localhost is also given in this file, but it doesn't do anything currently, as localhost is managd by the DNS itself.
Please note that this might happen when you uninstall Apache when it is running.
I feel like the Apache Process is running in the background, but Apache is not using it.
If you are sure Apache is not starting currently, enter the following command, hope it helps.
The command could be:
killall -9 apache2
OR
killall -9 httpd
OR
killall -9 apache
Replace apache with the other program's name if the program running on port 80 is not stoppable. Let me know it it doesn't work. Thanks.
It’ll be Skype, probably. I’ve found starting Apache (or nginx if we’re going that way) before starting Skype assists greatly in things being happy. As with cmak’s reply, sudo netstat -antup | grep 80
wIll quite likely return Skype.
/etc/hosts
will only work like a DNS file, it’s not what’s bound to ports.
Hope this helps.
Edit: For clarity - Skype by default will bind to :80. Apache and NGinx by default also bind on :80. You can't have two services bound to the same port. If you start Apache (or NGinX if you're going that way, or any containers of the like) before you start Skype, Skype should mount to another port.
The easiest way (using your terminal) would be to killall -9 Skype
, start Apache/NGinX and then start Skype again.
-
-
In every instance I've had this issue, and where Skype has been running, it has been Skype causing the issue as it binds on :80. Skype is running on the OPs machine, which you can see on the left hand side. Jan 19, 2020 at 3:21
-
sudo netstat -antup | grep 80