Loading... ## 部署后端程序 > 环境:全新纯净版 Windows Server 2016 数据中心版 64位中文版 ![PureNewSystem](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286456533863116.png) ### 安装IIS服务 1. 点击【开始】按钮 -> 选择 【服务器管理器】 ![ServerManager](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286458192272087.png) 2. 点击【仪表盘】选项 -> 选择【添加角色和功能】(在 角色和服务器组 中暂时没有IIS服务) ![AddNewFunction](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286460237225952.png) 3. 【开始之前】选项卡 -> 点击【下一步】 ![NextStep](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286461896926025.png) 4. 【安装类型】选项卡 -> 点击【下一步】(默认:基于角色或基于功能的安装) ![NextStep](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286463164420021.png) 5. 【服务器选择】选项卡 -> 点击【下一步】(默认:从服务器池中选择服务器) ![NextStep](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286465255048913.png) 6. 【服务器角色】选项卡 -> 选择【Web服务器(IIS)】-> 弹窗提示 ![SelectWebServerIIS](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286467412801061.png) ![AddIISFunction](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286469432764836.png) 7. 点击【添加功能】-> 【Web服务器(IIS)】已被选中 -> 点击【下一步】 ![IISIsSelected](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286471255254322.png) 8. 【功能】选项卡 -> 选择下图中的选项 -> 点击【下一步】 ![SelectFuntion1](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286475406250180.png) ![SelectFuntion2](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286476115589403.png) ![SelectFuntion3](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286477165041676.png) 9. 【Web服务器角色(IIS)】选项卡 -> 点击【下一步】 ![WebServerRule](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286477808836412.png) 10. 子【角色服务】选项卡 -> 选择下图中的选项 -> 点击【下一步】 ![RuleServer](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286481046092662.png) 11. 【确认】选项卡 -> 选择 [如果需要,自动重新启动目标服务器] -> 在新弹窗内选择 【是】-> 点击【安装】按钮 ![Require](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286482690038909.png) ![RequireReboot](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286484705955720.png) ![Install](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286486124438781.png) 12. 等待片刻 ![WaitAMoment](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286486778966819.png) 13. 安装成功 -> 点击【关闭】按钮 -> 已在角色和服务器组中出现IIS ![IISInstallSuccess](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286488746111327.png) 14. 验证IIS是否运行正常 -> 如下图 在右上角点击【工具】按钮 -> 选择【Internet Information Services(IIS)管理器】选项 -> 弹出新窗口 ![CheckIISRun](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286493122221683.png) 15. IIS管理器 -> 访问默认站点 -> 点击【浏览】 ![PreviewDefaultWebSite](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286496038719083.png) ![DefaultWebSiteTab](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286497603653217.png) ### 安装运行环境 > 根据后端程序的.NET版本进行安装(可以存在多个版本的运行时),本文中将以安装```.NET6.0```为示例 1. 安装运行时 ![InstallRuntime](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286508494598792.png) 2. 稍等片刻 ![WaitAMoment](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286509528737272.png) 3. 安装成功 ![InstallRuntimeSuccess](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286510285442921.png) 4. 验证是否安装成功 如下图【打开命令提示符】程序 -> 输入 ```dotnet```命令 正常输出 , 输入 ```dotnet --list-runtimes```命令 正常输出 到此,运行时安装成功 ![CheckRuntime](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286511899734067.png) ### 发布新应用 1. 创建程序文件夹 在C盘根目录下创建 ```wwwroot``` 目录 -> 接着创建 ```WebAppTest1``` 程序运行目录 ![ProgramRunPath](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286502471822020.png) 2. 将程序文件解压到```WebAppTest1```根目录下 ![Decompression](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286516841862013.png) 3. IIS创建新站点 ![AddNewWebSite](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286519323147739.png) 4. 配置站点 -> 点击【确定按钮】(选择 立即启动网站) 如下图 新加网站名称 , 配置站点路径 ![SetupConfig1](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286521088835598.png) 如下图 配置运行端口 ![SetupConfig2](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286522757282229.png) 5. 检查站点运行是否成功 ![CheckNewWebSite](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286534120615054.png) 6. 发布其他程序时,在```wwwroot``` 目录 -> 接着创建程序运行目录,从第2步开始继续执行操作即可 ### 关闭Internet Explorer增强功能 在服务器内访问其他站点时,由于安全规则限制,时常被提示不安全请求,非常影响使用体验 ![ErrorRequest](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286527896487735.png) 1. 关闭Internet Explorer增强功能 ![CloseIEExplorer](https://hwcloud.sdqps.top/ShareImages/PicGo/20230826/638286530358091787.png) 最后修改:2023 年 08 月 26 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 5 如果觉得我的文章对你有用,请随意赞赏