一、安装supervisor
1、确保有Python及pip后,执行pip install supervisor
2、之后执行echo_supervisord_conf > /etc/supervisor/supervisord.conf
生成一个配置文件
3、编辑/etc/supervisor/supervisord.conf
文件最后的[include]
部分,(注意:[include]
前面的分号要去掉)
4、执行supervisord -c /etc/supervisor/supervisord.conf
(如果启动不了,可能是要先结束掉已经在运行的该进程)
5、启动一个项目的示例
[program:lotto-socket]
process_name=%(program_name)s_%(process_num)02d
directory=/www/wwwroot/lotto
command=laravel-echo-server start
autostart=true
autorestart=true
user=www
numprocs=4
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-lotto-socket.log
6、执行supervisorctl
,在supervisorctl的命令行下,执行reread
,update
更新配置
二、安装frp内网穿透
参考https://github.com/fatedier/frp/blob/master/README_zh.md
三、安装node
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt install -y nodejs
四、运行laravel-echo-server
ssl证书相关的两个配置,在宝塔面板中生成的证书,先查看网站配置文件,获得两个pem
文件的路径,进到该路径发现两个pem
文件都是快捷方式,这里要填写两个原文件的路径,之前填的两个pem
文件的路径,一直不成功。
参考配置:
该示例对应的服务器地址为:https://test.domain.com
{
"authHost": "",
"authEndpoint": "/broadcasting/auth",
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": false,
"host": null,
"port": "6001",
"protocol": "https",
"socketio": {},
"sslCertPath": "/www/server/panel/vhost/cert/test.domain.com/fullchain.cer",
"sslKeyPath": "/www/server/panel/vhost/cert/test.domain.com/test.domain.com.key",
"sslCertChainPath": "",
"sslPassphrase": "",
"apiOriginAllow": {
"allowCors": false,
"allowOrigin": "",
"allowMethods": "",
"allowHeaders": ""
}
}
五、安装Monaco字体
git clone https://github.com/cstrap/monaco-font
./install-font-ubuntu.sh http://www.gringod.com/wp-upload/software/Fonts/Monaco_Linux.ttf
参考:Install monaco font on Ubuntu