發佈好的asp.net core mvc項目,html
若是想在window或linux下的以控制檯程序啓動的話,能夠用下面的命令linux
dotnet MyProject.dll --urls="https://localhost:7001;http://localhost:7000" --environment=Developmentwindows
默認端口爲5000(https爲5001)mvc
默認環境爲Productionasp.net
linux下,咱們能夠用supervisor來達到windows services的效果ui
supervisor簡單使用:url
/etc/supervisor/conf.d/xxx.confspa
[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
修改配置文件後,使新配置文件生效.net
supervisorctl update xxx
superversorctl help查看使用說明,有如下命令可使用rest
# 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