惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
I
InfoQ
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
量子位
博客园 - 叶小钗
月光博客
月光博客
IT之家
IT之家
G
Google Developers Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享

博客园 - builderman

运行abp install-libs的时候,提示"NPM is not installed"的原因及解决办法 nginx 基本操作 nginx 正向代理与反正代理的区别及简单配置 KeyCloak基础概念 用crontab定时分隔nginx日志文件 修改linux终端中当前用户的显示颜色 minikube使用笔记 ssh端口转发 kubectl proxy 让外部网络访问K8S service的ClusterIP 记录一下我在ubuntu下安装 minikube的过程 ssh ssh-keygen 私钥 docker vscode server docker network docker mysql8 phpmyadmin linux 压缩与解压缩 Ubuntu添加开机自动启动程序的方法 Linux基本命令集合 小修改,让mvc的验证锦上添点花(2) 小修改,让mvc的验证锦上添点花(1)
linux下使用supervisor启动.net core mvc website的配置
builderman · 2018-06-09 · via 博客园 - builderman

发布好的asp.net core mvc项目,

如果想在window或linux下的以控制台程序启动的话,可以用下面的命令

dotnet MyProject.dll --urls="https://localhost:7001;http://localhost:7000" --environment=Development

默认端口为5000(https为5001)

默认环境为Production

 linux下,我们可以用supervisor来达到windows services的效果

supervisor简单使用:

/etc/supervisor/conf.d/xxx.conf

[program: xxx]
command=dotnet xxx.dll
directory=/home/wwwroot/www.xxx.com/
autorestart=true
autostart=true
stderr_logfile=/home/wwwroot/www.xxx.com/Logs/xxx.err.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stdout_logfile=/home/wwwroot/www.xxx.com/Logs/xxx.out.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
environment=ASPNETCORE_ENVIRONMENT=Production,ASPNETCORE_URLS="https://localhost:6001;http://localhost:6000"
user=root
stopsignal=INT
startsecs=3

修改配置文件后,使新配置文件生效

superversorctl help查看使用说明,有以下命令可以使用

# supervisorctl help

default commands (type help <topic>):
=====================================
add    exit      open  reload  restart   start   tail   
avail  fg        pid   remove  shutdown  status  update 
clear  maintail  quit  reread  signal    stop    version

监控日志输出情况:
supervisorctl tail -f xxx [stdout|stderr]

相关文章:
https://www.cnblogs.com/felixzh/p/6099961.html