部署服务器错误笔记

1、部署后端IIS报错

HTTP Error 500.30 - ASP.NET Core app failed to start

通过事件查看器查看详细信息:

来源: IIS AspNetCore Module V2报错

错误1描述:

Failed to start application '/LM/W3SVC/2/ROOT', ErrorCode '0x8000ffff'.

 

错误2描述:

Could not find 'aspnetcorev2_inprocess.dll'. Exception message:
You must install or update .NET to run this application.

 

错误3描述:

Unable to locate application dependencies. Ensure that the versions of Microsoft.NetCore.App and Microsoft.AspNetCore.App targeted by the application are installed.

 

主要问题是因为错误2导致

 

Could not find 'aspnetcorev2_inprocess.dll'. Exception message:
You must install or update .NET to run this application.

 

App: D:\fms-simple\Pub\WebSite\WL.Admin.WebApi.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (x64)
.NET location: C:\Program Files\dotnet\

 

The following frameworks were found:
9.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

 

 

程序用的是8.0,只安装了9.0的SDK,就会报错

解决安装netcore8.0版本的SDK

 

另外,如果netcore的sdk和runtime版本一致没有问题,就是不是这个的问题

可能是:服务器的mysql密码不一致报错

这个错误是因为数据库链接字符串错误导致,密码:MysqlPwd3580!

 

 

2、启动后端数据库提示报错

Authentication method 'caching_sha2_password' failed. Either use a secure connection, specify the server's RSA public key with ServerRSAPublicKeyFile, or set AllowPublicKeyRetrieval=True.

身份验证方法“ caching_sha2_password”失败。 使用安全连接,或者使用ServerRSAPublicKeyFile指定服务器的RSA公钥,或者设置AllowPublicKeyRetrieval = True。

解决1:
最简单的解决方法是在连接后面添加 allowPublicKeyRetrieval=true

Server=www.itsvse.com;Port=3306;Database=dolphindb;User Id=root;Password=a123456;SSL Mode=none;AllowPublicKeyRetrieval=true;

如果用户使用了 sha256_password 认证,密码在传输过程中必须使用 TLS 协议保护,但是如果 RSA 公钥不可用,可以使用服务器提供的公钥;可以在连接中通过 ServerRSAPublicKeyFile 指定服务器的 RSA 公钥,或者AllowPublicKeyRetrieval=True参数以允许客户端从服务器获取公钥;但是需要注意的是 AllowPublicKeyRetrieval=True可能会导致恶意的代理通过中间人攻击(MITM)获取到明文密码,所以默认是关闭的,必须显式开启

mysql 8.0.17 默认密码的加密方式是 caching_sha2_password,如下图:

use mysql;
-- mysql 8.0.17
select user,plugin,authentication_string from user;

 

解决2:

caching_sha2_password 是 MySQL 8.0 引入的默认认证插件,替代了之前的 mysql_native_password。当客户端使用旧的认证机制尝试连接到 MySQL 服务器时,就可能出现 “auth failed” 错误。

mysql> ALTER USER 'canal'@'%' IDENTIFIED WITH mysql_native_password BY 'canal';
mysql> FLUSH PRIVILEGES;

 

解决3:执行sql语句,修改方式(推荐)

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';

FLUSH PRIVILEGES;

 

3、Nginx部署报错

9920#9924: host not found in upstream "localhost" in D:\fms-simple\tools\nginx-1.17.8/conf/nginx.conf:49

解决:localhost改为127.0.0.1

 

4、创建mysql数据库

字符:utf8mb4

排序:utf8mb4_general_ci


CREATE DATABASE ****不能带-
CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci;

 

 

5、常见命令:

1、命令来查看全局.NET SDK的版

dotnet -version

2.查看SDK

dotnet --list-sdks

3.查看运行时

dotnet --list-runtimes

4、这个命令会显示当前环境的详细信息,包括安装的.NET SDK和运行时版本。

dotnet --info

5、重启iis,管理员命令

iisreset

 

后端配置发布修改地址

 

posted on 2025-04-09 23:20  张彦山  阅读(121)  评论(0)    收藏  举报