GithubHelp home page GithubHelp logo

Comments (19)

andkom avatar andkom commented on June 21, 2024 95

example pm2 configuration:

echo.json:

{
  "name": "echo",
  "script": "laravel-echo-server",
  "args": "start"
}

command:

pm2 start echo.json

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on June 21, 2024 31

Here's a copy of the supervisor config file I have for my echo server for a rough guideline (on a vagrant machine)

[program:echo-server]
directory=/home/vagrant/path/to/your/project
command=/usr/bin/laravel-echo-server start
autostart=true
autorestart=true
user=vagrant
redirect_stderr=true
stdout_logfile=/home/vagrant/path/to/your/project/storage/logs/echoserver.log

from laravel-echo-server.

KrzysztofHajdamowicz avatar KrzysztofHajdamowicz commented on June 21, 2024 7

Systemd unit:

[Unit]
Description=Start a laravel-echo-server
After=network.target

[Service]
User=USER
Group=GROUP
WorkingDirectory=/var/lib/html/project
ExecStart=/usr/bin/laravel-echo-server start

Restart=on-failure

[Install]
WantedBy=multi-user.target

from laravel-echo-server.

wa05 avatar wa05 commented on June 21, 2024 3

I cant set PM2 (2.6.1) on Windows 7 with Node v8.1.4

PM2 Log:

C:\USERS\WALTER\APPDATA\ROAMING\NPM\LARAVEL-ECHO-SERVER.CMD:1
(function (exports, require, module, __filename, __dirname) { @if EXIST "%~dp0\node.exe" (
^
SyntaxError: Invalid or unexpected token
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:533:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Object. (C:\Users\Walter\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:70:21)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)

I'll try to run laravel-echo-server from a .bat and start the .bat with the Windows task scheduler or try to make work Supervisord on Windows creating a service with cygwin and python.. :/

1

from laravel-echo-server.

barryvdh avatar barryvdh commented on June 21, 2024 2

You can also just restart with supervisor. Don't know if there is a 'graceful' restart, but with the latest echo, the clients should just reconnect when the server is back.

from laravel-echo-server.

feenx avatar feenx commented on June 21, 2024

I'm running it with supervisor right now. Working perfectly for me, on my production server I've done the same except I had to use an absolute path to node in order to get the global installation of this package to fire up properly but it works great now.

from laravel-echo-server.

bendo01 avatar bendo01 commented on June 21, 2024

@pfeiferchristopher Thank You, I Will Try It With Supervisor

from laravel-echo-server.

jonnywilliamson avatar jonnywilliamson commented on June 21, 2024

@andkom Just to clarify though, using PM2 doesn't help with regard restarting the process if it exits? You'd still need supervisor/upstart etc?

from laravel-echo-server.

trip-somers avatar trip-somers commented on June 21, 2024

Is there a way to kill/restart the Laravel Echo Server when/if a new configuration goes live? This would be something akin to how Laravel allows you to restart your queue workers: php artisan queue:restart

from laravel-echo-server.

trip-somers avatar trip-somers commented on June 21, 2024

Does no one ever need to restart their Echo server?

from laravel-echo-server.

andkom avatar andkom commented on June 21, 2024

@jonnywilliamson

pm2 restart echo

will restart echo process

from laravel-echo-server.

trip-somers avatar trip-somers commented on June 21, 2024

Thanks, @barryvdh. I finally had time to look into that. I probably should have looked there first.

from laravel-echo-server.

ThunderBirdsX3 avatar ThunderBirdsX3 commented on June 21, 2024

@andkom How to call with config file laravel-echo-server.json

from laravel-echo-server.

catalinux avatar catalinux commented on June 21, 2024

That json config file it will be loaded by default. You need to run the server in the directory where the config file is placed

from laravel-echo-server.

jartaud avatar jartaud commented on June 21, 2024

Same as @wa05 comment

Node: v8.9.1
Npm: 5.5.1
Win10

from laravel-echo-server.

wa05 avatar wa05 commented on June 21, 2024

@jartaud tell me if you can run the daemon with this https://github.com/coreybutler/node-windows

from laravel-echo-server.

anddyyao avatar anddyyao commented on June 21, 2024

Same as @wa05
why

from laravel-echo-server.

wa05 avatar wa05 commented on June 21, 2024

Finally Im running it with windows task manager..

from laravel-echo-server.

peters305 avatar peters305 commented on June 21, 2024

You can also just restart with supervisor. Don't know if there is a 'graceful' restart, but with the latest echo, the clients should just reconnect when the server is back.

Hey Barry if you don't mind its little bit late but i was asking i want to start laravel-echo-server but i have dist folder after running npm build which includes index.html file how can start this

from laravel-echo-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.