0

I'm trying to run Mercure on my Raspbian.

First : I tried with mercure-legacy_0.13.0_Linux_armv6.tar.gz using the following command to run mercure

JWT_KEY='example'; ADDR='localhost:3000'; DEMO='1'; ALLOW_ANO NYMOUS='1'; CORS_ALLOWED_ORIGINS='*'; PUBLISH_ALLOWED_ORIGINS='*'; PUBLISHER_JWT_KEY='example' ./mercure run

It returns :

"msg":"Unexpected error","error":"listen tcp :80: bind: permission denied"

Second : I tried with mercure_0.13.0_Linux_armv6.tar.gz using the following command to run Mercure

MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' MERCURE_SUBSCRIBER_JWT _KEY='!ChangeMe!' ./mercure run

Caddy file :

 {
    {$GLOBAL_OPTIONS}
}

{
    auto_https off
}

{$SERVER_NAME:localhost}

log

route {
    encode zstd gzip

    mercure {
        # Transport to use (default to Bolt)
        transport_url {$MERCURE_TRANSPORT_URL:bolt://mercure.db}
        # Publisher JWT key
        publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
        # Subscriber JWT key
        subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
        # Extra directives
        {$MERCURE_EXTRA_DIRECTIVES}
    }

    respond /healthz 200

    respond "Not Found" 404
}

It returns :

run: loading initial config: loading new config: http app module: start: tcp: listening on :443: listen tcp :443: bind: permission denied


Can anyone provide a solution : I intend to host my symfony project on a web server using apache2 on the same Raspberrry

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90

2 Answers2

0

I don't know this specific application, but your error message:

listen tcp :80: bind: permission denied

could be related with restriction for ports 80 and 443 (second message) - non-root user cannot use ports lower than 1024 on standard Linux configuration. Try to use different port or (if you don't care about security - i.e. local hobby project) run app as root.

Keep in mind that you can run Nginx as reverse proxy, so you can run your app on any high port (like 3000) on standard user.

aso
  • 1,331
  • 4
  • 14
  • 29
0

it's a rights issue with your user.

Try with sudo, it should work.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 26 '22 at 11:17
  • That worked for me, thanks! I ran `sudo caddy run` instead of `caddy run` – Natblow Aug 16 '23 at 14:00