moismailzai / comments.ismailzai.com

Comments repository for ismailzai.com.
0 stars 0 forks source link

blog/symfony-mercure-apache #2

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Real-time Communications via Server-Sent Events: Mercure, Apache, PHP, and Symfony in Production | Mo Ismailzai

Mercure is an open protocol built on top of Server Side Events and helps facilitate real-time communications in web applications. I discuss how I integrated Mercure into an existing Apache-based Symfony application.

https://www.ismailzai.com/blog/symfony-mercure-apache

yasranwar commented 2 years ago

where write this code?

!/bin/bash

SYMFONY_ROOT="/var/www/html/apps" MERCURE_PATH="$SYMFONY_ROOT/bin/vendor/mercure"

MERCURE_PUBLISHER_JWT_KEY="$(cat $SYMFONY_ROOT/config/jwt/public.pem)" \ MERCURE_PUBLISHER_JWT_ALG="RS256" \ MERCURE_SUBSCRIBER_JWT_KEY="$(cat $SYMFONY_ROOT/config/jwt/public.pem)" \ MERCURE_SUBSCRIBER_JWT_ALG="RS256" \ $MERCURE_PATH run -config $SYMFONY_ROOT/Caddyfile

and how create this tls /etc/ssl/dev.crt /etc/ssl/dev.pem

entspannt commented 1 year ago

Thanks for the great tutorial and the additional help! With your help had changed the last line of the bash script to $MERCURE_PATH run --config $SYMFONY_ROOT/Caddyfile with the two dashes. Now it works like a charm.

@yasranwar: Although it's a bit late: The file is being used in the supervisord config. And you can create the pem file with let's encrypt. I used the fullchain.pem and privkey.pem files in the Caddyfile and cert.pem in the Apache config.

FPDK commented 1 year ago

Thank you very much for this article, it has saved me quite a few hours of trial and error.

mihaikelemen commented 1 year ago

I had to leave a comment here: your post was a life saver! Thanks!