Linux deployment

node

Installation address CD /usr/local/

2.1 installation node

download

Unpack the

Wget wget HTTP: / / https://nodejs.org/dist/v14.17.1/node-v14.17.1-linux-x64.tar.xzCopy the code
The tar XVF - node - v14.17.1 - Linux - x64. Tar. XzCopy the code

delete

The rm node - v14.17.1 - Linux - x64. Tar. XzCopy the code

Configuring environment Variables

Soft connection environment path point

Ln -s/usr/local/node - v14.17.1 - Linux - x64 / bin/node/usr/local/sbin/nodeCopy the code
Ln -s/usr/local/node - v14.17.1 - Linux - x64 / bin/NPM/usr/local/sbin/NPMCopy the code

mysql

rpm -ivh https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm 
Copy the code
yum install mysql-server
Copy the code

Set on start

systemctl enable mysqld.service
Copy the code

Check whether the installation is started

systemctl list-unit-files | grep mysqld
Copy the code

Setting the service

systemctl start mysqld.service
Copy the code

Check the default password of mysql

grep 'temporary password' /var/log/mysqld.log     
Copy the code
grep 'temporary password' /var/log/mysql/mysqld.log  
Copy the code

Password example: S >OpK/ijb3ln

2021-11-09T09:24:27.432545Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: s>OpK/ijb3ln
Copy the code

At the first login, you cannot enter the account and default password to change the password

mysql -u root -p
Copy the code

Enter the initial password to access the cli

Changing the Current Password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'Hqtcsz888.com';
Copy the code

Mysql > connect to MySQLHost Adress IP address

I quit because I changed my new password

exit

Log in again and start the operation

use mysql
Copy the code
Update user set host = '%' where user = 'root' // Update hostCopy the code

Root indicates the user name of the database that you want to connect to. % indicates that all machines are allowed to access user root. If this fails, the user name of the database may not be root.

ALTER USER 'root'@'%' IDENTIFIED BY 'Hqtcsz888.com' PASSWORD EXPIRE NEVER;
Copy the code

// Change the encryption mode

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Hqtcsz888.com'; 
Copy the code

// Update the user password

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Hqtcsz888.com'; 
Copy the code

nginx

Downloading compressed packages

Wget -c https://nginx.org/download/nginx-1.10.1.tar.gzCopy the code

Installing the GCC Environment

yum install gcc-c++
Copy the code

Installing PCRE PCRE – devel

yum install -y pcre pcre-devel
Copy the code

Install the zlib

yum install -y zlib zlib-devel
Copy the code

Install the Open SSL

yum install -y openssl openssl-devel
Copy the code

Unpack the nginx package

The tar - XVF nginx - 1.10.1. Tar. GzCopy the code
CD nginx - 1.10.1Copy the code

// Default Default configuration

./configure 
Copy the code

Compile and install nginx

make
Copy the code

If an error occurs, check whether the following error occurs:

Error: This statement may fallthrough [-werror =implicit-fallthrough=] h ^= data[2] < < 16;

Blog.csdn.net/qq_44689970…

After modification, make to check whether there is any error message. If yes, check whether the error is as follows

Nginx ‘struct crypt_data’ has no member named ‘current_salt

Blog.csdn.net/humanyr/art…

Or ((24 messages) Installation of Nginx for Linux _Heidenghua -CSDN blog)

After the modification, make to check whether there are any errors. If not, continue

then

make install
Copy the code

Start the nginx

Enter the /usr/local/nginx/sbin directory

./nginx
Copy the code

You can start

Enter the server address to access

Setting boot

Vim /etc/rc.local The editing page is displayed

Add a string of code at the bottom and hit keyboard I to go into insert mode

/usr/local/nginx/sbin/nginx
Copy the code

Press Esc to exit mode, colon: + wq to save and exit

extension

Shut down

./nginx -s quit
Copy the code

Restart the nginx

./nginx -s reload

Error solve nginx (24) : [error] open () “/ usr/local/nginx/logs/nginx pid” failed (2: No such file or directory)_ stream chu丶 private blog -CSDN blog

sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

Copy the code

View the nginx process

ps aux|grep nginx

configuration

[root] user root; worker_processes1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        logs/nginx.pid;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65; #gzip on; Server {# nginx 's listener port listen80;
        # server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /project/html/hqtc_pc;
            proxy_read_timeout 1500;  # 秒
            proxy_send_timeout 1500;
            send_timeout 1500;
            index  index.html index.htm;
        }
        location ^~ /datav {
            alias /project/html/dataV/;
        }
            # location /api/v1 {
            #    rewrite          ^/api/v1(/.*)$ $1 break;
            #    proxy_read_timeout 1500;  # 秒
            #    proxy_send_timeout 1500;
            #    send_timeout 1500;
            #    proxy_pass http://ip:90000;

            # }
        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
    include servers/*;

}


Copy the code

Code online

Use the git

yum install git -g
Copy the code
yum install git
Copy the code

The download is complete

Into the CD/usr/local /

git clone 
Copy the code

File entry xx.js

CD Project directory background

node app.js
Copy the code

Using XFTP

MySQL uses logical flow

1. Download files. Baidu web disk has tutorials and links

Mysql installation tutorial: www.cnblogs.com/mysqlanzhua…

1.1 File Configuration

1.2 Environment Configuration

2 View tool Navicat create database Note: For local access, the navicat connection host name must be localhost

Links to www.jb51.net/database/71…

  1. CMD enter /bin to connect to the database. Change the password. Log in to the database again

Can’t shut down