I am trying to use nginx to host a webpage. Running on a local VM immediately works, but on an external server not.
When typing nginx
into the console, the error reads as follows:
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
...
Running netstat to see what ports are used gave this output:
root@vm-1234567-41:~# netstat -lnp | grep -E ':80|8080'
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 894/nginx: master p
To me, this looks like it should. Only nginx is using the port so there shouldn't be another program using it, right?
Some things that didn't solve the issue:
sudo killall nginx
and then sudo systemctl start nginx
- stopping nginx with
systemctl stop nginx
and restarting again
- changing the port to any other port (always resulted in the same "Address already in use" error message)
Not sure if these actually have an influence, but I tried it anyways (without success):
- allowing http and https traffic with ufw
- allowing ports (80, 8080, etc.) with ufw
How would I go about fixing this? I'm at the point of thinking that the error message itself is hinting at a wrong error.
P.S:
- running
apache2
in the console is not recognized
- running
httpd
in the console is not recognized
- a Squid caching server is installed, but I'm not sure how to go about checking whether that is causing the issue.