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
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
download
wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpminstall
sudo yum install mysql80-community-release-el8-1.noarch.rpm -ysudo 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 executesudo yum install mysql-community-server -y
start-up
sudo systemctl start mysqldView the temporary password generated during installation
sudo cat /var/log/mysqld.log |grep passwordUse a temporary password to connect MySQL
mysql -uroot -pmodify root password
alter user [email protected] identified with mysql_native_password by ' Your password ';
install Nginx
Install dependencies
install gcc
yum -y install gccinstall pcre、pcre-devel
yum install -y pcre pcre-develinstall zlib
yum install -y zlib zlib-develinstall openssl
yum install -y openssl openssl-devel
install nginx
- download
wget http://nginx.org/download/nginx-1.20.1.tar.gz
If you are prompted command not found, Then execute first.
yum install wgetinstall
decompression
tar zxvf nginx-1.20.1.tar.gzEntry directory
cd nginx-1.20.1install and configure , Execute sequentially
./configuremakemake install
If you are prompted command not found, Then execute first.
yum -y install gcc automake autoconf libtool makeinstall
start-up nginx service
cd /usr/local/nginx/sbin./nginxsee nginx Whether the service started successfully
ps -ef | grep nginxAccess your server IP
See the welcome page .
Set the power on auto start
Enter into /lib/systemd/system/ Catalog
cd /lib/systemd/system/establish nginx.service file
vim nginx.service
If you are prompted command not found, Then execute first.
yum -y install viminstall
- 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
start-up nginx
systemctl start nginx.serviceAdd power on self start
systemctl enable nginx.serviceView the current status of the service
systemctl status nginx.service
install .Net Core
- install
sudo dnf install dotnet-sdk-3.1
Create database
Connect to database engine
mysql -uroot -pCreate database
create database kfSwitch to database
use kfCreate 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
Upload and unzip Server Catalog
tar -xvf Server.taredit nginx The configuration file
vim /usr/local/nginx/conf/nginx.confstay Server node Level Add the following
Be carefulserver_nameReplace 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
Reload nginx The configuration file
cd /usr/local/nginx/sbin./nginx -s reloadtest run
cd /root/wwwroot/Server/dotnet Sheng.Linkup.Server.dll &Access to the domain name , Get into Status Check the status
https://kf-api.yourname.com/Status

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

Set power on self start
Get into
cd /lib/systemd/system/create a file
vim kfServer.serviceEnter the following and save to exit
Be carefulWorkingDirectoryFor 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
Start the server main program
systemctl start kfServer.serviceSet boot up
systemctl enable kfServer.serviceView 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
Upload and unzip Resource Catalog
tar -xvf Resource.taredit nginx The configuration file
vim /usr/local/nginx/conf/nginx.confstay Server node Level Add the following
Be carefulserver_nameReplace with your domain name .locationUnder therootafter 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;
}
}
- 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 .

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

- On initial start-up , Configure service address .

- 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
- 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 .








