# Websocket Setup

#### Supervisor Configuration <a href="#supervisor-configuration" id="supervisor-configuration"></a>

Just as creating queue\_manager.conf to help keep laravel queue running, we need to create new conf for laravel reverb.

To create a new file from within the supervisor config directory called "**reverb\_manager.conf**" or "**reverb\_manager.ini**" and the content of the file should be as follows.

Create the config file using the command below:

**Ubuntu**

```
nano /etc/supervisor/conf.d/reverb_manager.conf
```

**CentOS**

```
nano /etc/supervisord.d/reverb_manager.ini
```

Then paste the follow code in the file:

```
[program:laravel_reverb]
process_name=%(program_name)s_%(process_num)02d
command=php /PATH_TO_YOUR_BACKEND/artisan reverb:start
startsecs = 0
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stderr_logfile=/PATH_TO_YOUR_BACKEND/storage/logs/larareverb.err.log
stdout_logfile=/PATH_TO_YOUR_BACKEND/storage/logs/larareverb.out.log
stderr_logfile_maxbytes=200KB
stdout_logfile_maxbytes=200KB
```

In the code above, you have to replace the following with the right values on your server: **PATH\_TO\_*****YOUR\_BACKEND** replace with the directory path of where you backend files is location, usually its something like **home/USERNAME/public\_*****html**

You may also need to change the **"user=root"**, change it to the user you are logged in in your terminal, usually is root user, so you can set: **user=root**

#### Step 3: Start/Restart Supervisor <a href="#step-3-start-restart-supervisor" id="step-3-start-restart-supervisor"></a>

Once you have created the configuration, you can start/restart the supervisor process. To start supervisor you can run the following commands.

```
sudo supervisorctl stop all
sudo supervisorctl reread
sudo supervisorctl update
```

#### **Step 4: Start the queue** <a href="#step-4-start-the-queue" id="step-4-start-the-queue"></a>

Run the command below to start just the **laravel\_reverb** you just created above

```
sudo supervisorctl start laravel_reverb
```

**Note:** If nothing works after run the command above, you can rather run the command below, to make supervisor start all configs:

```
sudo supervisorctl start all
```

**Done!!**
