开始安装
安装MysqL
https://blog.csdn.net/qq_37525851/article/details/122332850
1.使用wget指令下载YUM Repositry并安装以找到合适的YUM Server
wget -i -c http://dev.MysqL.com/get/MysqL57-community-release-el7-10.noarch.rpm
yum -y install MysqL57-community-release-el7-10.noarch.rpm
2.用yum指令下载并安装MysqL
yum -y install MysqL-community-server
MysqL安装失败-GPG验证不通过
在yum install 版本后面加上 --nogpgcheck,即可绕过GPG验证成功安装。比如yum install MysqL-community-server --nogpgcheck
3.启动服务
systemctl start MysqLd.service
4.查看root的临时密码
grep "password" /var/log/MysqLd.log
MysqL -u root -p
//修改密码策略
set global validate_password_policy = 0 //0-低强度,1-中强度,2-高强度
set global validate_password_length=4 //修改最小密码长度
set password for 'root'@'localhost'=password('root') //更新密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
7.开启远程登陆
use MysqL
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
flush privileges;
//另一台主机通过MysqL连接远程数据库
MysqL -h 1.1.1. -p3306 -u root -p
8.0开机启动
systemctl enable MysqLd
systemctl daemon-reload
9.0
配置默认编码为utf8:
配置默认编码为utf8
修改/etc/my.cnf配置文件,在[MysqLd]下添加编码配置,如下所示:
[MysqLd]
character_set_server=utf8
init_connect='SET NAMES utf8'
安装.NET6.0
CentOS 7 ✔️
安装 .NET 之前,请运行以下命令,将 Microsoft 包签名密钥添加到受信任密钥列表,并添加 Microsoft 包存储库。 打开终端并运行以下命令:
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
安装运行时
sudo yum install aspnetcore-runtime-6.0
运行测试 加上星号和端口才支持外网连接
dotnet xxxx.dll --urls http://*:5000
//以下操作二选一
systemctl status firewalld // 查看防火墙状态 systemctl stop firewalld //关闭防火墙 firewall-cmd --zone=public --add-port=5000/tcp --permanent // permanent参数是永远存在,不然的话,重启后就没有了
firewall-cmd --reload // 重启防火墙 ,添加端口后记得执行此命令
安装.Nginx
rpm -Uvh http://Nginx.org/packages/centos/7/noarch/RPMS/Nginx-release-centos-7-0.el7.ngx.noarch.rpm yum install -y Nginx //这句才是真正的安装Nginx
systemctl start Nginx //启动Nginx,就是这么简单
systemctl enable Nginx //将Nginx设为开机启动
配置Nginx
位置/etc/Nginx/conf.d/default.conf
server { listen 80 default_server; location / { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
保存后,记得Nginx -t,检查一下
然后重启下Nginx
Nginx -s reload //重启Nginx
监视应用
配置web应用为后台服务
vi /usr/lib/systemd/system/webname.service
[Unit] Description=Webname Web App [Service] WorkingDirectory=/home/ftpuser/var/www Environment=ASPNETCORE_ENVIRONMENT=Production ExecStart=/usr/bin/dotnet NetCore.fw.web.dll Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
#开机自启
systemctl enable webname.service
systemctl start webname.service
参考
https://www.cnblogs.com/caijt/p/10978324.html
https://docs.microsoft.com/zh-cn/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website
https://blog.csdn.net/u013120365/article/details/86064315
https://www.cnblogs.com/hicuiyang/p/10407748.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。