zoukankan      html  css  js  c++  java
  • linux下使用supervisor启动.net core mvc website的配置

    发布好的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

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

    supervisorctl update xxx

    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



  • 相关阅读:
    图片轮播插件比较(jquerySlide与superSlide)
    footer贴底的纯css实现方法
    input line-height 兼容解决方案
    HBuilder js 自定义代码块
    HBuilder HTML 自定义代码块
    HBuilder CSS 自定义代码块
    Element-ui el-cascader不触发prop?
    css水平垂直居中
    本地存储时注意的问题
    银行卡号,每四位添加空格
  • 原文地址:https://www.cnblogs.com/builderman/p/9160228.html
Copyright © 2011-2022 走看看