• 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



  • 相关阅读:
    flask路由+视图
    flask基本使用1
    返回对象时字典化
    python3连接redis
    selected_related和prefetch_related
    django删除migrations导致初始化数据库失效
    vue添加拦截器(身份认证)以及cookie认证
    vue添加使用全局变量
    列表:动手试一试
    转来的字符串编辑方式
  • 原文地址:https://www.cnblogs.com/builderman/p/9160228.html
Copyright © 2020-2023  润新知