当前位置:网站首页>Linux runs shengxunwei online customer service system: implementation method of supporting SQL server and MySQL at the same time

Linux runs shengxunwei online customer service system: implementation method of supporting SQL server and MySQL at the same time

2022-06-09 15:19:00 Caoxusheng (sheng.c)

Some time ago, I published a series of articles , Let's start with .net core Online customer service system development process .
A lot of friends have been hoping to support MySQL database , Considering that some friends are already using it SQL Server, I can't leave you in the process of upgrading SQL Server Support for , The system must support at the same time SQL Server and MySQL.

To simplify the installation and deployment process , I developed a matching configuration tool .

Using automated configuration tools , Can be in “ Database engine ” In this item , Switch SQL Server and MySQL, Instead of deploying two different programs .

In this article, I will introduce :

  • CentOS Installation configuration MySQL database , Create database , Execute the script to create the table structure .
  • install Nginx, Reverse proxy to customer service system server , And set the power on self starting
  • install .net core , Deploy the customer service system and start it automatically

I detailed the entire process of the commands that need to be executed , Follow this article in 30 Deploy in minutes .

brief introduction

Shengxunwei online customer service and marketing system is based on .net core / WPF Developed an online customer service software , The purpose is : to open up 、 Open source 、 share . Strive to build .net An excellent open source product of the community .

Full privatization package download address

https://kf.shengxunwei.com

Current version information

Release date : 2022-5-15
Database version : 20220219a
Communication protocol version : 20220306
Server version : 1.10.5.0
Customer service program version : 1.9.3.0
Resource site version : 1.5.9.0
Web Manage background versions : 1.1.7.0

Preparing the operating system

  • This article takes CentOS 8.3 Take an example to illustrate , Other versions of Linux The installation and configuration process is similar .

Open the firewall port

Customer service system is used by default 9527 Port to communicate , If the firewall is turned on , Please open this port in the firewall .

You can also change to other available port numbers , In the subsequent configuration of customer service system server program to do the corresponding modification .

Please make sure that the firewall service provided by your host service provider is , The corresponding port is also opened . For example, Alibaba cloud server needs to be configured in security group rules .

install MySQL Database engine

  1. download
    wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm

  2. install
    sudo yum install mysql80-community-release-el8-1.noarch.rpm -y
    sudo yum install mysql-community-server -y

If the Error: Unable to find a match: mysql-community-server
Then execute first. yum module disable mysql
And then execute sudo yum install mysql-community-server -y

  1. start-up
    sudo systemctl start mysqld

  2. View the temporary password generated during installation
    sudo cat /var/log/mysqld.log |grep password

  3. Use a temporary password to connect MySQL
    mysql -uroot -p

  4. modify root password
    alter user [email protected] identified with mysql_native_password by ' Your password ';

install Nginx

Install dependencies

  1. install gcc
    yum -y install gcc

  2. install pcre、pcre-devel
    yum install -y pcre pcre-devel

  3. install zlib
    yum install -y zlib zlib-devel

  4. install openssl
    yum install -y openssl openssl-devel

install nginx

  1. download
    wget http://nginx.org/download/nginx-1.20.1.tar.gz

If you are prompted command not found, Then execute first. yum install wget install

  1. decompression
    tar zxvf nginx-1.20.1.tar.gz

  2. Entry directory
    cd nginx-1.20.1

  3. install and configure , Execute sequentially
    ./configure
    make
    make install

If you are prompted command not found, Then execute first. yum -y install gcc automake autoconf libtool make install

  1. start-up nginx service
    cd /usr/local/nginx/sbin
    ./nginx

  2. see nginx Whether the service started successfully
    ps -ef | grep nginx

  3. Access your server IP
    See the welcome page .

Set the power on auto start

  1. Enter into /lib/systemd/system/ Catalog
    cd /lib/systemd/system/

  2. establish nginx.service file
    vim nginx.service

If you are prompted command not found, Then execute first. yum -y install vim install

  1. Enter the following and save to exit
    Pay attention to the nginx The installation path
[Unit]
Description=nginx service
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target

Content description

Description: Describe the service
After: Describe the service category
[Service] Setting of service running parameters
Type=forking It's in the form of background operation
ExecStart Run the command for the service
ExecReload For restart command
ExecStop For the order to stop
PrivateTmp=True Indicates that a service is assigned a separate temporary space
Be careful :[Service] Start of 、 restart 、 All stop commands require absolute paths
[Install] Settings related to service installation at run level , Can be set to multi-user , That is, the operation level of the system is 3

  1. start-up nginx
    systemctl start nginx.service

  2. Add power on self start
    systemctl enable nginx.service

  3. View the current status of the service
    systemctl status nginx.service

install .Net Core

  1. install
    sudo dnf install dotnet-sdk-3.1

Create database

  1. Connect to database engine
    mysql -uroot -p

  2. Create database
    create database kf

  3. Switch to database
    use kf

  4. Create database table structure
    source createDatabase.sql

Configure the server main program

Please confirm that the configuration file of the server main program has been configured .
Refer to the : Use automation tools to configure server-side programs

Configure the main program site

  1. Upload and unzip Server Catalog
    tar -xvf Server.tar

  2. edit nginx The configuration file
    vim /usr/local/nginx/conf/nginx.conf

  3. stay Server node Level Add the following
    Be careful server_name Replace with your domain name .

map $http_upgrade $connection_upgrade {
  default upgrade;
  ''   close;
 }
upstream dotnet_server_proxy {
        server localhost:5000;                                                
        keepalive 2000;
   }
  server{
        listen 80;
        listen [::]:80;

        server_name kf-api.yourname.com;

        location / {
                    proxy_pass http://dotnet_server_proxy;
                    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 $remote_addr;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection $connection_upgrade;
        }
}

Sample file :https://kf.shengxunwei.com/freesite/nginx.conf.txt

  1. Reload nginx The configuration file
    cd /usr/local/nginx/sbin
    ./nginx -s reload

  2. test run
    cd /root/wwwroot/Server/
    dotnet Sheng.Linkup.Server.dll &

  3. Access to the domain name , Get into Status Check the status
    https://kf-api.yourname.com/Status

  1. Initialization data
    Access to the domain name , Get into Status/Setup command
    Such as :https://kf-api.yourname.com/Status/Setup

Set power on self start

  1. Get into
    cd /lib/systemd/system/

  2. create a file
    vim kfServer.service

  3. Enter the following and save to exit
    Be careful WorkingDirectory For you Server Catalog

[Unit]
Description=kfServer service
After=network.target
[Service]
Type=simple
GuessMainPID=true
WorkingDirectory=/root/wwwroot/Server/
StandardOutput=journal
StandardError=journal
ExecStart=dotnet Sheng.Linkup.Server.dll &
Restart=always
[Install]
WantedBy=multi-user.target
  1. Start the server main program
    systemctl start kfServer.service

  2. Set boot up
    systemctl enable kfServer.service

  3. View running status
    systemctl status kfServer.service

Configure static resource sites

Please confirm that the configuration file of the server main program has been configured .
Refer to the : Use automation tools to configure server-side programs

Configure static resource sites

  1. Upload and unzip Resource Catalog
    tar -xvf Resource.tar

  2. edit nginx The configuration file
    vim /usr/local/nginx/conf/nginx.conf

  3. stay Server node Level Add the following
    Be careful server_name Replace with your domain name .
    location Under the root after Resource Directory path .

server {
        listen       80;
        server_name  kf-resource.yourname.com;

        location / {
            root   /root/wwwroot/Resource;
            index  v.html;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
}
  1. Give access to the directory
chmod 777 /root
chmod 777 /root/wwwroot
chmod 777 /root/wwwroot/Resource

Configure and publish customer service program

This page shows the customer service configuration description of the privatized deployment version , If you use it online , Please go to : Download and install customer service software

Customer service side program running requirements

operating system :

  • Windows 7 SP1 Or later
  • Windows Server 2008 R2 SP1 Or later

rely on :

  • This program requires .Net Framework 4.8 Or later .
    The free version of the private deployment package already provides “ndp48-web.exe”, This is a .Net Framework 4.8 Online installation program for , Recommended . Only 1 MB More size , Can automatically determine whether the computer has been installed .Net Framework 4.8 .

Statement

Customer service program without any malicious code and after virus scanning . It uses :

  • ESET Internet Security
  • McAfee Total Protection

If the setup program displays Windows SmartScreen Filter window , Please click on “ For more information ” after , Click on “ function ” button .

Why this window appears It's not the discovery of malicious code , It simply means that the program has no corporate signature .
Code signing certificates are expensive , It costs nearly ten thousand yuan a year , For free software The high cost of .
Besides 360 If there is a similar prompt, it is also due to similar reasons , It's not the discovery of malicious code , It's about asking for help 360 Pay the certification fee .

Start the customer service program

Compress the “Shell” The directory is the customer service program .

  1. find Shell In the catalog “Sheng.Linkup.Client.Shell.exe”.

  1. On initial start-up , Configure service address .

  1. When the configuration is complete , Show the login screen .

  • If you are prompted No version information was returned , Because after configuring the server main program , No initialization data . Please refer to Configure the server main program At the end of .
  • If you log in and prompt “ This operation is not allowed on non connected sockets ”, Please check the fire protection configuration of the server , Add the communication rules used by the customer service system to the inbound rules , Refer to the : Preparing the operating system
  1. Fill in the default password “123”, Click on “ Sign in ” Entry system .

Visitor chat test

After logging into customer service , Use your browser to open the chat page under the domain name of your resource site , Such as :

kf-resource.shengxunwei.com/WebChat/WebChat.html?sitecode=freesite

Start talking .

Release

The configured customer service program Shell Catalog , Compress or package and distribute it to customer service .

Integrate

原网站

版权声明
本文为[Caoxusheng (sheng.c)]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206091501509470.html