.net core 部署在Linux系统

2020-06-23  本文已影响0人  YANG_LIVE

1.首先是mysql的安装
我用的链接工具是putty,首先root登入系统

1.png
-采用yum的方式安装mysql
1.安装mysql的yum源
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
2.png
2.安装mysql-community.repo
mysql-community-source.repo依赖包
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
3.png
3.安装mysql
yum install -y mysql-server
4.png
6.png
7.png
4.运行mysql,并查看运行状态
service mysqld start
service mysqld status
8.png
5.由于mysql5.7 会生成一个随机密码,所有先查看密码 (mysql5.6 也有随机密码,5.5不知道)
grep "password" /var/log/mysqld.log
箭头值得就是随机密码,我们记录下来
9.png
6.登录 MySQL并更新用户 root 的密码,这里我们设置了passwordA1.作为新密码
mysql -u root -p
SET PASSWORD = PASSWORD('passwordA1.');
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
flush privileges;
10.png
11.png
7.设置mysql可以被任意ip访问和root 本地访问
grant all privileges on . to root@"%" identified by "passwordA1.";
grant all privileges on . to root@"localhost" identified by "passwordA1.";
12.png
flush privileges;
8.MySQL控制命令:启动、停止、重启、查看状态
service mysqld start
service mysqld stop
service mysqld restart
service mysqld status
systemctl start mysqld
service mysqld stop
service mysqld restart
systemctl status mysqld
9.测试远程连接
13.png
  1. .net core2.1的安装
    参照官方文档,地址:https://www.microsoft.com/net/learn/dotnet/hello-world->tutorial#install
    1.添加yum源
    sudo rpm -Uvh >https://packages.microsoft.com/config/rhel/7/packages-microsoft->prod.rpm
    14.png
    2.升级所有包同时也升级软件和系统内核
    sudo yum update
    15.png
    3.安装.net core
    sudo yum install dotnet-sdk-2.1.4
    16.png
    17.png
  2. nginx的安装
    1.添加nginx源
    sudo rpm -Uvh >http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
    18.png
    2.安装nginx
    sudo yum install nginx
    19.png
    3.启动nginx并设置开机启动
    sudo systemctl start nginx.service
    sudo systemctl enable nginx.service
    20.png
    访问web服务成功
    21.png
上一篇下一篇

猜你喜欢

热点阅读