🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 系统服务 **软链接** ln -s /home/centos/hmsc/hmsc-api.service /etc/systemd/system **操作命令** ``` sudo su - block # 启动 程序 .service 可以省略 sudo systemctl start block-user-rpc.service # 停止程序 sudo systemctl stop block-user-rpc # 查看日志 sudo journalctl -fu block-user-rpc # 启动配置 sudo systemctl <start|stop|status> <服务单元 我们的应用都是 block-开头的> ``` **配置案例** ``` [Unit] Description=WebServer(dotnet) After=network.target [Install] WantedBy=multi-user.target [Service] User=tljs WorkingDirectory=/tljs/app/WebServer ExecStart=/tljs/env/dotnet/dotnet Green.Web.Host.dll ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=always RestartSec=30s ``` ## Doracrm安装错误解决方案 ``` 1. rm -rf package-lock.json 2.npm cache verify 3.npm cache clean --force ``` ## github访问 (1)C:\Windows\System32\drivers\etc (2)编辑hosts文件在最后加上如下的地址,具体的ip可以去网站http://ipaddress.com/上查。 192.30.253.112 github.com 192.30.253.113 www.github.com 192.30.253.121 nodeload.github.com 151.101.12.133 raw.github.com 151.101.12.133 documentcloud.github.com 151.101.12.133 pages.github.com ## AWS更换密钥 1.在aws后台生成并下载密钥,然后将密钥保存到自己电脑。 2.执行: ssh-keygen -y -f bsc.pem,复制密钥路径,回车得到public key,例如 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCMAS8mviirg23XvhyGzydp0VlP/fyfuhsHKMECZydc5ewytvTq0mqYTfjKBS++PeBpEL1Zx/ilEYCmgY6omTrIMtG8s1jf/lAk0l9++f2ldp/w2U86seARyRxVEePU7YCnbofqgtGJJDASDHNiEbshXQ6M49nUsE6tfETG3sFl+XDeva0lkNkssA4JDU+eivPRGma3XcBAXvsUsD8VkKQJvudrpJDSjjncdjYOVd2Wcrcj5Li8MmLvIkEX1pmqTT6O6oUfEtCdpVi4tCwTXV5ydU8UtjJDSGDFSJgbY9Unve4LgjgoWF677FdUpvVFD1NPoLH bsc 3.利用以前的密钥登录服务器,将上面第二步的public key粘贴到~/.ssh/authorized_keys 或者相应登录用户的.ssh目录(我的是/home/ubuntu/.ssh/authorized_keys) 然后将旧的public key注释或者删除。 4.然后你就可以利用新的密钥文件(.pem后缀文件)登录服务器了 例如:ssh -i bsc.pem ubuntu@192.168.1.1 ## linux 启动后台服务 nohup /home/centos/test/hmsc api >> /home/centos/test/hmsc/hmsc.log 2>&1 & ## [CentOS7安装Supervisor3.1.4][1] supervisord 负责管理进程的server端,配置文件是/etc/supervisor/supervisord.conf supervisorctl client端的命令行工具,管理子进程,配置文件在/etc/supervisor/supervisord.d/目录下 安装supervisor yum install -y supervisor (如果用的是阿里云的CentOS7会提示找不到supervisor, 则yum install epel-release先安装EPEL源) 开机自启 systemctl enable supervisord 启动supervisord systemctl start supervisord 查看状态 systemctl status supervisord **进程实例** ``` [program:carsvr] directory = /home/centos/carsvr command = /home/centos/carsvr/ruchengcar admin autostart = true startsecs = 5 autorestart = true startretries = 3 user = centos redirect_stderr = true stdout_logfile_maxbytes = 20MB stdout_logfile_backups = 20 stdout_logfile = /home/centos/carsvr/logs/carsvr_stdout.log ```