[Essay] Centos deployment 7 .net core webapi

Original: [essays] Centos deploy .net core webapi 7

1, install .net core sdk on centos7 3.1
Tutorial official official advice given directly run the installation I installed the sdk found dependencies run also installed
https://docs.microsoft.com/zh-cn/dotnet/ Core / the install / Linux-Package-Manager-centos7 the install-The-#-Core-ASPNET Runtime
DOTNET --version

2, centos7 install MySQL 8
Official Tutorial: HTTPS: //dev.mysql.com/doc/refman/8.0/en/linux-installation-yum-repo.html#yum-repo-installing-mysql
1. Download the source install mysql package https://dev.mysql.com/downloads/repo/yum/
MySQL Yum Repository
I used here: mysql80-Community Community-Release-el7-3.noarch.rpm
shell> wget http://dev.mysql.com /get/mysql80-community-release-el7-1.noarch.rpm

2. Installation source mysql
shell> sudo yum localinstall mysql80-community -release-el7-3.noarch.rpm

3.安装MySQL
shell> yum install mysql-community-server

4. Start MySQL service
shell> systemctl start mysqld

The boot
systemctl enable mysqld.service enable mysqld or systemctl
systemctl Start mysqld
systemctl STOP mysqld
systemctl Status mysqld
6. The default password acquisition
shell> sudo grep 'temporary password' /var/log/mysqld.log

7. By using a login and set a temporary password generated as soon as the superuser account a custom password to change the root password:
shell> MySQL-uroot--p /// usr / local / MySQL / bin / MySQL -utz -p -h127 .0.0.1
MySQL> the ALTER the USER 'the root' @ 'localhost' the IDENTIFIED BY 'MyNewPass4!';

8. Turn off the firewall
systemctl disable firewalld.service

9. Create a new user
CREATE USER 'lylong' @ '% ' IDENTIFIED BY '901109';

10. Modify the encryption method, this step can not change
mysql8.0 default encryption method is "caching_sha2_password", but only supports previous navicat "mysql_native_password", so the next change your password encryption method
ALTER USER 'lylong' @ '% ' IDENTIFIED WITH mysql_native_password BY '901109';
modified can perform select host, user, plugin from user ; statement to see whether new subscribers plugin is "mysql_native_password"

11. Set the remote login account may be
the GRANT ALL PRIVILEGES the ON . The TO 'lylong' @ '%';

12. permission to refresh
flush privileges;

3, centos7 installation Nodejs
download nodejs latest tar package
can be found on the download page Download https://nodejs.org/en/download/ in. And executes the instructions
wget https://nodejs.org/dist/v12.14.0/node-v12.14.0-linux-x64.tar.xz
extracting
tar -xvf node-v12.14.0-linux- x64.tar.xz
deployment bin file associations
LN /www/node-v12.4.0-linux-x64/bin/node -s / usr / local / bin / the Node
LN /node-v12.4.0-linux-x64/bin/npm -s / usr / local / bin / npm
4, installation PM2
npm install -g PM2 @ Latest
if -bash: pm2: command not found need to associate
ln -s /home/data/nodejs/node-v12.14.0-linux-x64/bin/pm2 / usr / local / bin / pm2
5, gateway services out of the box
pm2 running gateway service
"DOTNET Bumblebee.ConsoleServer.dll" --name gateway pm2 start
ADMIN: tzadmin 2019 @
6, start gameapi services Branch started two
pm2 start "dotnet TZY.GameApi.dll" --name gameapi_8086
pm2 start "dotnet TZY.GameApi.dll" --name gameapi_8087
7、设置开机启动
pm2 startup
pm2 save

8, the operation on Mysql
connection: / usr / local / mysql / bin / mysql -utz -p -h127.0.0.1 tz
create the database: create database database name charset = 'utf8';
Create table:
use Database name;
the CREATE TABLE fileuploadhistory(
IdBIGINT (20 is) the AUTO_INCREMENT the NOT NULL,
FileExtentionVARCHAR (255) the CHARACTER the SET NULL the DEFAULT UTF8 the COLLATE utf8_general_ci the COMMENT 'file extension .jpg',
a PRIMARY KEY ( Id)
) = ENGINE the InnoDB the AUTO_INCREMENT the DEFAULT = 10000 = the CHARSET = UTF8 the COLLATE utf8_general_ci the ROW_FORMAT the DYNAMIC = ;
insert data:
iNSERT INTO fileuploadhistory (Id, FileExtention) values (10000, '. JPG');


__EOF__

Author : N1ck
out at : https://www.cnblogs.com/koyuki/archive/2019/12
About Bloggers : love life, love reading / travel, like technology, specializes happy. Comments and private messages will reply in the first time. Or direct private letter to me.
Copyright : Attribution - Noncommercial - No Derivative, protocol plain text | Protocol legal texts .
Solidarity with the blogger : If you think the article is helpful to you, you can click on the bottom right corner of the article [ recommend ] it. Your encouragement is the greatest power bloggers!

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/12121679.html