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