我正在使用 Laravel Websockets 包 https://beyondco.de/docs/laravel-websockets/getting-started/introduction。
在我的本地开发服务器上,我使用命令php artisan websockets:server
运行成功,但我想知道如何在我的生产服务器(Ubuntu + Apache2)上运行它。
我正在使用 Laravel Websockets 包 https://beyondco.de/docs/laravel-websockets/getting-started/introduction。
在我的本地开发服务器上,我使用命令php artisan websockets:server
运行成功,但我想知道如何在我的生产服务器(Ubuntu + Apache2)上运行它。
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName your.domain.com
ProxyPass / http://localhost:6001/
ProxyPassReverse / http://localhost:6001/
</VirtualHost>
将6001更改为您的websocket端口。
如果要在后台运行,您需要使用nohup或pm2将websocket服务器添加到后台。例如:
pm2 start "php artisan websockets:server"
或者使用nohup
nohup php artisan websockets:server
php artisan websockets:serve
命令?或者只需要配置 Apache 就可以了吗? - Fantasmic