一楔壤、安裝supervisor
1巡语、確保有Python及pip后似踱,執(zhí)行pip install supervisor
2、之后執(zhí)行echo_supervisord_conf > /etc/supervisor/supervisord.conf
生成一個配置文件
3沐旨、編輯/etc/supervisor/supervisord.conf
文件最后的[include]
部分,(注意:[include]
前面的分號要去掉)
4榨婆、執(zhí)行supervisord -c /etc/supervisor/supervisord.conf
(如果啟動不了磁携,可能是要先結(jié)束掉已經(jīng)在運行的該進(jìn)程)
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良风、執(zhí)行supervisorctl
谊迄,在supervisorctl的命令行下,執(zhí)行reread
拖吼,update
更新配置
二鳞上、安裝frp內(nèi)網(wǎng)穿透
參考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證書相關(guān)的兩個配置篙议,在寶塔面板中生成的證書,先查看網(wǎng)站配置文件,獲得兩個pem
文件的路徑鬼贱,進(jìn)到該路徑發(fā)現(xiàn)兩個pem
文件都是快捷方式移怯,這里要填寫兩個原文件的路徑,之前填的兩個pem
文件的路徑这难,一直不成功舟误。
參考配置:
該示例對應(yīng)的服務(wù)器地址為: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