Example tutorials for running zkeacms on CentOS

Source: Internet
Author: User
Tags webhost
This article is mainly for you to introduce the CentOS run Zkeacms detailed process, with a certain reference value, interested in small partners can refer to

Zkeacms Core was developed based on. NET core and can be run across platforms on Windows, Linux, and Macs, and then we'll look at how to run Zkeacms on CentOS.

Installing the. Net Core Runtime

Run the following command to install the. Net Core Runtime

sudo yum install libunwind libicucurl-ssl-o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=843420sudo mkdir-p/ Opt/dotnet && sudo tar zxf dotnet.tar.gz-c/opt/dotnetsudo ln-s/opt/dotnet/dotnet/usr/local/bin

Installing Nginx

sudo yum install epel-releasesudo yum install Nginxsudo systemctl enable Nginx

Modify the Nginx configuration

Modify the Nginx configuration, let it reverse proxy to localhost:5000, modify the global configuration file/etc/nginx/nginx.conf, modify the location node for the following content

Location/{  Proxy_pass http://localhost:5000;  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; }

Start Nginx

sudo systemctl start nginx

Here, our environment is well matched, and then we'll publish Zkeacms

Release Zkeacms. Core

Release Zkeacms. The Core is relatively simple, double-click Publish.cmd

Database SQLite

For the sake of simplicity, here SQLite is used as a database to generate a SQLite data named Database.sqlite. Under the published Programs folder, create the App_Data folder and put the Database.sqlite in the App_Data directory. about how to generate SQLite data, you can go to the group inquiry, or self-Baidu/Google.

Modify the connection string

Open Appsettings.json, join SQLite Database connection string, the result is as follows

{"ConnectionStrings": {  "defaultconnection": "",  "Sqlite": "Data source=app_data/database.sqlite",  " MYSQL ":" "}," Applicationinsights ": {  " Instrumentationkey ":" "}," Logging ": {  " includescopes ": false,  " LogLevel ": {   " Default ":" Debug ",   " System ":" Information ",   " Microsoft ":" Information "  }}," Culture ": "ZH-CN"}

Package Upload Server

We packaged the released program as Cms.zip and uploaded it to the/root directory. and extract it to the/ROOT/CMS directory and unzip it using the following command

Unzip cms.zip-d CMS


Run

Navigate to the directory and run with the dotnet command

Cd/root/cmsdotnet Zkeacms. WebHost.dll

After successful operation, you can use your server's IP or domain name to access the:)

After exiting the SSH remote connection client, it was found that the access was not available because dotnet also exited.

Run as Service

Create a service that lets dotnet run in the background. Installing the Nano Editor

Yum Install Nano

Create a service

sudo nano/etc/systemd/system/zkeacms.service

Enter the following to save

[Unit]  Description=zkeacms  [Service]  workingdirectory=/root/cms  execstart=/usr/local/bin/dotnet/root/cms/ Zkeacms. WebHost.dll  restart=always  restartsec=10  syslogidentifier=zkeacms  user=root  environment= Aspnetcore_environment=production  [Install]  Wantedby=multi-user.target

Start the service

Systemctl Start Zkeacms.service

This allows you to safely exit SSH remote connection.

"Recommended"

1.. Net Core Graphics Verification Code

2.. NET core configuration file loading with di injection configuration data

3.. NET Core CLI Tool documentation Dotnet-publish

4. Detailed introduction to ZKEACMS for. Net Core

5. Sharing. NET MVC using forms to validate instance code

6. How do I make HTTP requests under. NET Core?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.