ZKEACMS Core is developed based on .net core and can run cross-platform on windows, linux, and mac. Next, let’s take a look at how to use Jexus hosting to run ZKEACMS on CentOS. Usually we Linux deploys ASP.NET Core applications. According to Microsoft’s official documentation, we usually need Nginx with Systemd (https://docs.microsoft.com/en-us/aspnet/core /publishing/linuxproduction), Nginx did not take over the Kestrel process. We need to maintain two processes, which increases the complexity. If you deploy asp.net core on windows, we can use IIS to take over the Kestrel process. We can also use Jexus on Linux to achieve the same experience as IIS.
Installation .Net Core runtime
Follow the official documentation https://www.microsoft.com/net/core#linuxcentos: Run The following command, install .Net Core Runtime
sudo yum install libunwind libicu curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=843421 sudo mkdir -p /usr/local/dotnet && sudo tar zxf dotnet.tar.gz -C /usr/local/dotnet sudo ln -s /usr/local/dotnet/dotnet /usr/local/bin
Install Jexus
按照《CentOS 7.2下安装Mono 5.0》安装好了Mono 5, 我这里是安装通用版的Jexus,通用版的Jeuxs 才能使用到我们自己安装的最新版的Mono 5。安装 Jexus 直接使用一下命令即可(需要在root身份下执行):
curl https://jexus.org/release/install | sh
安装成功后会提示:OK, Jexus has been installed in /usr/jexus.
备注:
你可以直接安装独立版的Jexus,独立版的Jexus自带Mono,使用的是Mono的稳定版本4.8,安装命令也是一个命令就可以搞定:curl https://jexus.org/release/x64/install.sh|sh
Publish ZKEACMS.Core
DatabaseMySql
I am using Tencent Cloud’s Cloud Database MySQL (Cloud Database for MySQL), which is a high-performance distributed data storage service professionally built by Tencent Cloud based on MySQL, the world’s most popular open source database. 100% fully compatible with MySQL protocol, suitable for relational database scenarios. ZKEACMS Core uses Oracle's official Mysql driver by default. Since Oracle's official mysql driver has many problems, it is still a beta version and has not been updated recently. I use it in the production environment. It is Pomelo.EntityFrameworkCore.MySql. I changed the MySQL driver of ZKEACMS to Pomelo.EntityFrameworkCore.MySql. After testing, it works well. I have pulled the relevant modifications to ZKEACMS. MySQL for .NET Core - Pomelo extension package series includes Pomelo.Data.MySql and Pomelo.EntityFrameworkCore.MySql. It is recommended for everyone to use and has been tested in actual projects.
The database script of ZKEACMS Core is only SQL Server. There are many tools to convert SQL Server database to MySQL, so I won’t introduce them in detail here. Publish ZKEACMS.CorePublishing ZKEACMS.Core is relatively simple, double-click Publish.cmdString
Open appsettings. json, add the MySQL database connection string, the result is as follows
{ "Connection
Strings": { "DefaultConnection": "",
"
Sqlite": "", "MySql": "Server=10.66.241.199;Database=ZKEACMS_Core;User Id=root;Passw
ord=xxxxxxx;" },
"ApplicationInsights": {
"Instrumentation
Key": "" },
"Logging": {
"
IncludeScopes": false, "LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"CDN": {
"Enable": true,
"Url": "http://cdn.zkeasoft.com/core"
},
"Culture": "zh-CN"
}
UploadServer
We will upload the released program and winscp program to the server/var/www /csharpkit directory, for specific operations, please refer to the article "Using WinSCP software to transfer files in Windows and Linux"配置Jexus运行ZKEACMS Core
定位到目录,然后使用 dotnet 命令运行
cd /var/www/csharpkit
dotnet ZKEACMS.WebHost.dll
运行成功以后,就可以使用您服务器的IP或者域名访问了,默认访问的端口是5000 退出SSH远程连接客户端后,发现访问不了,这是因为 dotnet 也退出了。下面我们就通过Jexus来管理我们服务进程。
使用以下命令:
1、切换到Jexus配置文件目录
cd /usr/jexus/siteconf
2、复制默认的配置文件为test
cp default csharpkit
3、编辑csharpkit配置文件
nano csharpkit
######################
# Web Site: csharpkit
########################################
port=80
root=/ /var/www/csharpkit
hosts=www.csharpkit.com #OR your.com,*.your.com
AppHost={
cmd=dotnet /var/www/csharpkit/ZKEACMS.WebHost.dll;
root=/var/www/csharpkit;
port=0;
}
配置的重点就在于AppHost中,需要注意的是在AppHost中的port(端口号)不代表Jexus对外服务的port(端口号),而是指要转发的 Asp.Net Core应用程序的端口号,如果在程序中使用了UsrUrls自定义端口则使用UsrUrls中填写的端口(不建议使用UsrUrls自定义端口),在没有使用UsrUrls自定义端口的情况下端口号设置为 0,Jexus会在运行时与Asp.Net Core进行"协商"具体使用的端口号,避免多个应用分配,端口的麻烦和冲突的风险。 简单来说就是会将外部的请求转发到这个端口,由这个端口对应的Asp.Net Core应用程序对请求进行处理。
4、启动/重启 Jexus
当配置文件编辑完成后使用以下命令对Jexus进行 启动/重启
# 如果已启动 Jexus: sh /usr/jexus/jws restart # 如果未启动 Jexus: sh /usr/jexus/jws start
启动/重启成功后,在浏览器中输入 ip地址/域名:端口号 例如(http://www.csharpkit.com/) 即可访问Asp.Net Core应用程序
以上即是Jexus托管Asp.Net Core应用程序的配置全过程
The above is the detailed content of Running ZKEACMS using Jexus hosting. For more information, please follow other related articles on the PHP Chinese website!

C# plays a core role in the .NET ecosystem and is the preferred language for developers. 1) C# provides efficient and easy-to-use programming methods, combining the advantages of C, C and Java. 2) Execute through .NET runtime (CLR) to ensure efficient cross-platform operation. 3) C# supports basic to advanced usage, such as LINQ and asynchronous programming. 4) Optimization and best practices include using StringBuilder and asynchronous programming to improve performance and maintainability.

C# is a programming language released by Microsoft in 2000, aiming to combine the power of C and the simplicity of Java. 1.C# is a type-safe, object-oriented programming language that supports encapsulation, inheritance and polymorphism. 2. The compilation process of C# converts the code into an intermediate language (IL), and then compiles it into machine code execution in the .NET runtime environment (CLR). 3. The basic usage of C# includes variable declarations, control flows and function definitions, while advanced usages cover asynchronous programming, LINQ and delegates, etc. 4. Common errors include type mismatch and null reference exceptions, which can be debugged through debugger, exception handling and logging. 5. Performance optimization suggestions include the use of LINQ, asynchronous programming, and improving code readability.

C# is a programming language, while .NET is a software framework. 1.C# is developed by Microsoft and is suitable for multi-platform development. 2..NET provides class libraries and runtime environments, and supports multilingual. The two work together to build modern applications.

C#.NET is a powerful development platform that combines the advantages of the C# language and .NET framework. 1) It is widely used in enterprise applications, web development, game development and mobile application development. 2) C# code is compiled into an intermediate language and is executed by the .NET runtime environment, supporting garbage collection, type safety and LINQ queries. 3) Examples of usage include basic console output and advanced LINQ queries. 4) Common errors such as empty references and type conversion errors can be solved through debuggers and logging. 5) Performance optimization suggestions include asynchronous programming and optimization of LINQ queries. 6) Despite the competition, C#.NET maintains its important position through continuous innovation.

The future trends of C#.NET are mainly focused on three aspects: cloud computing, microservices, AI and machine learning integration, and cross-platform development. 1) Cloud computing and microservices: C#.NET optimizes cloud environment performance through the Azure platform and supports the construction of an efficient microservice architecture. 2) Integration of AI and machine learning: With the help of the ML.NET library, C# developers can embed machine learning models in their applications to promote the development of intelligent applications. 3) Cross-platform development: Through .NETCore and .NET5, C# applications can run on Windows, Linux and macOS, expanding the deployment scope.

The latest developments and best practices in C#.NET development include: 1. Asynchronous programming improves application responsiveness, and simplifies non-blocking code using async and await keywords; 2. LINQ provides powerful query functions, efficiently manipulating data through delayed execution and expression trees; 3. Performance optimization suggestions include using asynchronous programming, optimizing LINQ queries, rationally managing memory, improving code readability and maintenance, and writing unit tests.

How to build applications using .NET? Building applications using .NET can be achieved through the following steps: 1) Understand the basics of .NET, including C# language and cross-platform development support; 2) Learn core concepts such as components and working principles of the .NET ecosystem; 3) Master basic and advanced usage, from simple console applications to complex WebAPIs and database operations; 4) Be familiar with common errors and debugging techniques, such as configuration and database connection issues; 5) Application performance optimization and best practices, such as asynchronous programming and caching.

C# is widely used in enterprise-level applications, game development, mobile applications and web development. 1) In enterprise-level applications, C# is often used for ASP.NETCore to develop WebAPI. 2) In game development, C# is combined with the Unity engine to realize role control and other functions. 3) C# supports polymorphism and asynchronous programming to improve code flexibility and application performance.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver CS6
Visual web development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
