Unable to bind to IP

this has never happened before.

the only thing i’ve done recently is added nginx for a pleroma instance, to the server.
but when i stop the nginx via systemctl stop nginx.service

trying to launch writefreely still throws the following error:

(sidenote of import: it’s been working JUST fine for over a year…)

root@mail:/www-data/html/writehere.is/writefreely# ./run-writehere.sh
2023/03/30 20:49:37 Starting WriteFreely 0.13.1…
2023/03/30 20:49:37 Loading config.ini configuration…
2023/03/30 20:49:37 Loading templates…
2023/03/30 20:49:37 Loading pages…
2023/03/30 20:49:37 Loading user pages…
2023/03/30 20:49:37 Loading encryption keys…
2023/03/30 20:49:37 Connecting to mysql database…
2023/03/30 20:49:37 Initializing local timeline…
2023/03/30 20:49:37 Adding www.writehere.is routes (multi-user)…
2023/03/30 20:49:37 Going to serve…
2023/03/30 20:49:37 Serving on https://82.221.143.49:443
2023/03/30 20:49:37 Using manual certificates
2023/03/30 20:49:37 —
2023/03/30 20:49:37 Serving redirects on http://82.221.143.49:80
ERROR: 2023/03/30 20:49:37 app.go:497: Unable to start redirect server: listen tcp 82.221.143.49:80: bind: permission denied
ERROR: 2023/03/30 20:49:37 app.go:511: Unable to start: listen tcp 82.221.143.49:443: bind: permission denied
root@mail:/www-data/html/writehere.is/writefreely#

if anyone has any clues as to what I can check or look at, I’d be most appreciative.

Thanks in advance. :slight_smile:

@help

additionally i ran ./writefreely --debug and it launched fine and i was able to load my blog in two different browsers.

AH! Okay, I figured it out. disregard all of this.

I’m going to change this to “solution.”

I had changed something in my bash scripting that lead to this error.

for anyone that might know:

can go bind to 80 and 443 as a non root user? or does the script have to be launched as root?

Ports below 1024 are privileged on Linux. So to bind on ports 80 and 443 you would need to run WF or any application either as root (though not recommended, security-wise), or use CAP_NET_BIND_SERVICE to bind to these ports without running WF as root, as explained here.

1 Like

Matt, Thank you. That’s just what I was looking for.