Created
July 20, 2023 02:35
-
-
Save aceraven777/3e2c58d32db777f87c950c3166d78659 to your computer and use it in GitHub Desktop.
Setup Server (own Websocket)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su | |
# WEBSOCKET START | |
# Install PHP 7.4. you can use 'php74' command | |
yum groupinstall -y "Development Tools" | |
yum install -y php74 | |
yum install -y php74-php-xml php74-php-mbstring php74-php-pear php74-php-devel | |
# Install ev extension to open connection limit (this will override the default system 1024 concurrent limit connection) | |
/opt/remi/php74/root/usr/bin/pecl install ev | |
vim /etc/opt/remi/php74/php.d/40-ev.ini | |
... | |
; Enable ev extension module | |
extension = ev | |
... | |
##################################### | |
##################################### | |
### SETUP YOUR WEBSOCKET INSIDE /usr/share/nginx/html | |
### php74 /usr/local/bin/composer install | |
##################################### | |
##################################### | |
# CHANGE .env for both SITE and WEBSOCKET | |
... | |
PUSHER_APP_HOST=website.com | |
PUSHER_APP_ID=395602 | |
PUSHER_APP_KEY=aaaaa | |
PUSHER_APP_SECRET=bbbbb | |
PUSHER_APP_PORT=6001 | |
PUSHER_APP_CLUSTER=ap1 | |
PUSHER_CURLOPT_SSL_VERIFYHOST=2 | |
PUSHER_CURLOPT_SSL_VERIFYPEER=1 | |
MIX_PUSHER_APP_HOST="${PUSHER_APP_HOST}" | |
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | |
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" | |
MIX_PUSHER_APP_PORT="${PUSHER_APP_PORT}" | |
LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=/etc/letsencrypt/live/website.com/fullchain.pem | |
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK=/etc/letsencrypt/live/website.com/privkey.pem | |
LARAVEL_WEBSOCKETS_VERIFY_PEER=false | |
... | |
vim /etc/supervisord.d/website-websockets.conf | |
... | |
[program:website-websockets] | |
command=php74 /usr/share/nginx/html/websocket/artisan websockets:serve --port=6001 | |
numprocs=1 | |
autostart=true | |
autorestart=true | |
umask=002 | |
user=root | |
group=root | |
... | |
systemctl restart supervisord | |
supervisorctl reread | |
supervisorctl update | |
systemctl restart nginx | |
service php-fpm restart | |
# WEBSOCKET END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment