一、前言

  1、简单记录一下Linux CentOS 7中安装与配置Tengine的详细步骤。

  2、简单比较一下Tengine 和Nginx

  3、搭建Asp.net Core和部署 Web程序

  4、总结一下操作

  5、# 表示目前我使用的权限是root 最高权限,$ 表示我使用的权限是一般用户权限。

二、开始安装环境

  Tengine是淘宝发起的web服务器项目,简单的讲就是对nginx进行了二次开发并提供了更丰富的功能,

  Tengine的性能和稳定性已经在大型的网站如淘宝网,天猫商城等得到了很好的检验

  它的最终目标是打造一个高效、稳定、安全、易用的Web平台。

  从2011年12月开始,Tengine成为一个开源项目。

  现在,它由Tengine团队开发和维护。Tengine团队的核心成员来自于淘宝、搜狗等互联网企业。

  官网地址:http://tengine.taobao.org/,目前最新的稳定版本是2.3.0,我这里也用的这个版本。

1、查看环境

cat /etc/redhat-release
CentOS Linux release 7.6. (Core)
 

2、下载安装包安装Tengine-2.3.0(这一步可以跳过,直接使用命令安装,比较方便)

  下载pcre-8.39.tar.gz【依赖】 、下载zlib-1.2.11.tar.gz【依赖】 、下载openssl-1.0.1h.tar.gz【依赖】 、下载jemalloc-3.6.0.tar.bz2  【依赖】 、下载 tengine-2.3.0.tar.gz

  【http://tengine.taobao.org/download/tengine-2.3.0.tar.gz】

 安装命令

# cd /usr/local/src/
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
# wget http://zlib.net/zlib-1.2..tar.gz
# wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz
# wget http://www.canonware.com/download/jemalloc/jemalloc-3.6..tar.bz2
# wget http://tengine.taobao.org/download/tengine-2.3..tar.gz

3、通过命令行运行安装Tengine-2.3.0

  在安装之前首先检查一下是否已安装nginx的一些模块依赖的lib库,诸如g++、gcc、pcre-devel、openssl-devel和zlib-devel。所以下面这些命令最好挨个跑一遍,已安装的会提示不用安装,未安装或需要更新的则会执行安装及更新。

 安装命令

 yum install gcc-c++
yum -y install pcre pcre-devel
yum -y install zlib zlib-devel
yum -y install openssl openssl-devel

 执行这个是有用的,让系统自动检测安装比较省事。  我没有使用wget 下载解压安装

 具体操作如下

[root@centos001 ~]# yum install gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
...........................................更新安装
Total download size: 8.7 M
Installed size: M
Is this ok [y/d/N]: y
Downloading packages:
(/): libstdc++-devel-4.8.-.el7_6..x86_64.rpm | 1.5 MB ::
(/): gcc-c++-4.8.-.el7_6..x86_64.rpm | 7.2 MB ::
-----------------------------------------------------------------------------------------------------------------------------------------------
Total MB/s | 8.7 MB ::
Running transaction check
...........................................更新安装
Complete!
[root@centos001 ~]# yum -y install pcre pcre-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package pcre-8.32-.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
...........................................更新安装
Installed:
pcre-devel.x86_64 :8.32-.el7 Complete!
[root@centos001 ~]# yum -y install zlib zlib-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package zlib-1.2.-.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package zlib-devel.x86_64 :1.2.-.el7 will be installed
--> Finished Dependency Resolution
...........................................更新安装
Installed: zlib-devel.x86_64 :1.2.-.el7 Complete!
[root@centos001 ~]#  yum -y install openssl openssl-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package :openssl-1.0.2k-.el7_6..x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
...........................................更新安装
Dependency Installed:
keyutils-libs-devel.x86_64 :1.5.-.el7 krb5-devel.x86_64 :1.15.-.el7_6 libcom_err-devel.x86_64 :1.42.-.el7
libkadm5.x86_64 :1.15.-.el7_6 libselinux-devel.x86_64 :2.5-14.1.el7 libsepol-devel.x86_64 :2.5-.el7
libverto-devel.x86_64 :0.2.-.el7 Complete!

至此,操作结束。依赖包安装完毕

3、安装Tengine,安装主程序在这里

安装命令

下载Tengine-2.3.0主程序,查询下载安装包情况

 cd /usr/local/src/
wget http://tengine.taobao.org/download/tengine-2.3..tar.gz
ls

解压安装包文件  

tar -zxvf tengine-2.3..tar.gz

到指定目录修改安装配置

cd /usr/local/src/tengine-2.3.
./configure 

生成编译

make
sudo make install

具体操作如下

[root@centos001 ~]# cd /usr/local/src/
[root@centos001 src]# wget http://tengine.taobao.org/download/tengine-2.3..tar.gz
---- ::-- http://tengine.taobao.org/download/tengine-2.3..tar.gz
Resolving tengine.taobao.org (tengine.taobao.org)... 140.205.230.4
Connecting to tengine.taobao.org (tengine.taobao.org)|140.205.230.4|:... connected.
HTTP request sent, awaiting response... OK
Length: (.3M) [application/octet-stream]
Saving to: ‘tengine-2.3..tar.gz’ %[=====================================================================================================>] ,, .30MB/s in .8s -- :: (1.30 MB/s) - ‘tengine-2.3..tar.gz’ saved [/] [root@centos001 src]# ls
tengine-2.3..tar.gz
[root@centos001 src]# tar -zxvf tengine-2.3.0.tar.gz
...........................................解压一堆文件
tengine-2.3.0/tests/test-nginx/test-nginx/t/syntax.t
[root@centos001 src]# ls
tengine-2.3.0 tengine-2.3.0.tar.gz
[root@centos001 ~]# cd /usr/local/src/tengine-2.3.0
[root@centos001 tengine-2.3.0]# ./configure
checking for OS
+ Linux 3.10.0-957.5.1.el7.x86_64 x86_64
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ using system zlib library
+ jemalloc library is disabled nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
 [root@centos001 tengine-2.3.0]# make
make -f objs/Makefile
make[1]: Entering directory `/usr/local/src/tengine-2.3.0'
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I src/proc -I objs \
...........................................一堆文件
sed -e "s|%%PREFIX%%|/usr/local/nginx|" \ -e 
"s|%%PID_PATH%%|/usr/local/nginx/logs/nginx.pid|"
\ -e "s|%%CONF_PATH%%|/usr/local/nginx/conf/nginx.conf|" \
-e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \
< man/nginx.8 > objs/nginx.8 make[1]: Leaving directory `/usr/local/src/tengine-2.3.0'

[root@centos001 tengine-2.3.0]# sudo make install
  make -f objs/Makefile install
  make[1]: Entering directory `/usr/local/src/tengine-2.3.0'
  test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
  test -d '/usr/local/nginx/sbin' \
  || mkdir -p '/usr/local/nginx/logs'
  make[1]: Leaving directory `/usr/local/src/tengine-2.3.0'
  [root@centos001 tengine-2.3.0]#

至此,安装基本结束,剩下配置文件

4、配置Tengine

  Tengine完全兼容Nginx,因此可以参照Nginx的方式来配置Tengine。

  我们在此只列出Tengine中值得注意的功能。关于详细的Tengine的相对于Nginx的差别,可以访问变更列表

编辑文件

vi /lib/systemd/system/nginx.service 

输入内容 ,点击编辑,按键:esc 输入 :wq 保存配置文件

#pei zhi wen jian
[Unit] Description=The nginx HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target [Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true [Install]
WantedBy=multi-user.target

 设置权限,我设置失败了,使用默认权限

chmod  nginx.service

  操作命令 

###--启动nginx服务
systemctl start nginx.service ###--设置开机自启动
systemctl enable nginx.service ###--停止开机自启动
# systemctl disable nginx.service ###--查看服务当前状态
systemctl status nginx.service ###--重新启动服务
systemctl restart nginx.service ###--查看所有已启动的服务
systemctl list-units --type=service

 具体操作如下

make[1]: Leaving directory `/usr/local/src/tengine-2.3.0'
[root@centos001 tengine-2.3.0]# vi /lib/systemd/system/nginx.service
[root@centos001 tengine-2.3.0]# chmod 745 nginx.service
chmod: cannot access ‘nginx.service’: No such file or directory
[root@centos001 tengine-2.3.0]# cd
[root@centos001 ~]# chmod 745 nginx.service
chmod: cannot access ‘nginx.service’: No such file or directory
[root@centos001 ~]# systemctl start nginx.service
[root@centos001 ~]# chmod 745 nginx.service
chmod: cannot access ‘nginx.service’: No such file or directory
[root@centos001 ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2019-05-08 17:48:40 CST; 4min 44s ago
Process: 9286 ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf (code=exited, status=0/SUCCESS)
Process: 9285 ExecStartPre=/usr/local/nginx/sbin/nginx -t (code=exited, status=0/SUCCESS)
Main PID: 9290 (nginx)
CGroup: /system.slice/nginx.service
├─9290 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
└─9291 nginx: worker process

May 08 17:48:40 centos001 systemd[1]: Starting The nginx HTTP and reverse proxy server...
May 08 17:48:40 centos001 nginx[9285]: nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
May 08 17:48:40 centos001 nginx[9285]: nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
May 08 17:48:40 centos001 systemd[1]: Failed to read PID from file /usr/local/nginx/logs/nginx.pid: Invalid argument
May 08 17:48:40 centos001 systemd[1]: Started The nginx HTTP and reverse proxy server.
[root@centos001 ~]#

配置结束,访问可以看到一个介绍页面。表示成功

Welcome to tengine!

If you see this page, the tengine web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to tengine.taobao.org.

Thank you for using tengine.

二、安装Net Core环境

官方推荐安装方式:

Install .NET Core SDK on Linux CentOS / Oracle - x64

下载安装NET包 

In your terminal, run the following commands:

sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm

安装 .NET SDK

Update the products available for installation, then install the .NET SDK.

In your terminal, run the following commands:

sudo yum update
sudo yum install dotnet-sdk-2.2

#可以看到版本号意味着安装成功

dotnet --version
dotnet --info

 具体操作如下

[root@centos001 ~]# sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
Retrieving https://packages.microsoft.com/config/rhel//packages-microsoft-prod.rpm
warning: /var/tmp/rpm-tmp.wBQ0lQ: Header V4 RSA/SHA256 Signature, key ID be1229cf: NOKEY
Preparing... ################################# [%]
Updating / installing...
:packages-microsoft-prod-1.0-.el7################################# [%]
[root@centos001 ~]# sudo yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
packages-microsoft-com-prod | 2.9 kB ::
packages-microsoft-com-prod/primary_db | kB ::
Resolving Dependencies
--> Running transaction check
......................................................等待漫长安装

Install 2 Packages
  Upgrade 49 Packages

Total download size: 167 M
  Is this ok [y/d/N]: y
  Downloading packages:

......................................................等待漫长安装

Complete!

[root@centos001 ~]# sudo yum install dotnet-sdk-2.2
  Loaded plugins: fastestmirror
  Loading mirror speeds from cached hostfile
  Resolving Dependencies
  --> Running transaction check

......................................................等待漫长安装

Dependency Installed:
  aspnetcore-runtime-2.2.x86_64 0:2.2.4-1 dotnet-host.x86_64 0:2.2.4-1 dotnet-hostfxr-2.2.x86_64 0:2.2.4-1
  dotnet-runtime-2.2.x86_64 0:2.2.4-1 dotnet-runtime-deps-2.2.x86_64 0:2.2.4-1 libicu.x86_64 0:50.1.2-17.el7

Complete!
  [root@centos001 ~]# dotnet --info
  .NET Core SDK (reflecting any global.json):
  Version: 2.2.101
  Commit: 236713b0b7

Runtime Environment:
  OS Name: centos
  OS Version: 7
  OS Platform: Linux
  RID: centos.7-x64
  Base Path: /root/dotnet/sdk/2.2.101/

Host (useful for support):
  Version: 2.2.0
  Commit: 1249f08fed

.NET Core SDKs installed:
  2.2.101 [/root/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.0 [/root/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.0 [/root/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.0 [/root/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

三、部署Net Core web 程序

1、利用ftp服务器上传web文件

我这里上传程序文件到Centos服务的目录是:/home/sopftpuser/ftp/upload/Tools

详细文章看:https://www.cnblogs.com/sopcce/p/10743241.html

2、访问你部署的程序

cd /root/sop/tools
dotnet Sop.Tools.dll #运行web应用,这里就是web程序运行的类库
dotnet Sop.Tools.dll --server.urls http://*:5000 

3、部署服务

vi /usr/lib/systemd/system/sop.tools.service
[Unit]
Description=Example .NET Web API App running on CentOS [Service]
WorkingDirectory=/root/sop/tools
ExecStart=/usr/bin/dotnet /root/sop/tools/Sop.Tools.dll
Restart=always
# Restart service after seconds if the dotnet service crashes:
RestartSec=
KillSignal=SIGINT
SyslogIdentifier=dotnet-sop-tools
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false [Install]
WantedBy=multi-user.target
##--后台程序重新编译生产
systemctl daemon-reload
##--启动服务
systemctl start sop.tools.service
##--停止服务
systemctl stop sop.tools.service
##--重启服务
systemctl restart sop.tools.service
##--查看服务
systemctl status sop.tools.service
##--输入日志
journalctl -fu sop.tools.service

 具体操作如下

[root@centos----20G ~]# systemctl daemon-reload
[root@centos----20G ~]# systemctl start sop.tools.service
[root@centos----20G ~]# systemctl status sop.tools.service
● sop.tools.service - Example .NET Web API App running on CentOS
Loaded: loaded (/usr/lib/systemd/system/sop.tools.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) since Thu -- :: CST; 2s ago
Process: ExecStart=/usr/bin/dotnet /root/sop/tools/Sop.Tools.dll (code=exited, status=/SUCCESS)
Main PID: (code=exited, status=/SUCCESS)
[root@centos----20G ~]# systemctl restart sop.tools.service
[root@centos----20G ~]# systemctl status sop.tools.service
● sop.tools.service - Example .NET Web API App running on CentOS
Loaded: loaded (/usr/lib/systemd/system/sop.tools.service; disabled; vendor preset: disabled)
Active: active (running) since Thu -- :: CST; 4s ago
Main PID: (dotnet)
CGroup: /system.slice/sop.tools.service
└─ /usr/bin/dotnet /root/sop/tools/Sop.Tools.dll May :: centos----20G dotnet-sop-tools[]: User profile is available. Using '/root/.aspnet/DataProtection-Keys...rest.
May :: centos----20G dotnet-sop-tools[]: warn: Microsoft.AspNetCore.Server.Kestrel[]
May :: centos----20G dotnet-sop-tools[]: Unable to bind to http://localhost:5000 on the IPv6 loopback interf...ess'.
May :: centos----20G dotnet-sop-tools[]: Hosting environment: Production
May :: centos----20G dotnet-sop-tools[]: Content root path: /root/sop/tools
May :: centos----20G dotnet-sop-tools[]: Now listening on: http://localhost:5000
May :: centos----20G dotnet-sop-tools[]: Now listening on: https://localhost:5001
May :: centos----20G dotnet-sop-tools[]: Application started. Press Ctrl+C to shut down.
May :: centos----20G dotnet-sop-tools[]: warn: Microsoft.AspNetCore.Server.Kestrel[]
May :: centos----20G dotnet-sop-tools[]: Unable to bind to https://localhost:5001 on the IPv6 loopback inter...ess'.
Hint: Some lines were ellipsized, use -l to show in full.
[root@centos----20G ~]#

查看日志

sudo journalctl -fu sop.tools.service

有关进一步筛选,使用时间选项(如 --since today--until 1 hour ago)或这些选项的组合可以减少返回的条目数。

sudo journalctl -fu kestrel-helloapp.service --since "2016-10-18" --until "2016-10-18 04:00"

4、部署服务nginx

vi /usr/local/nginx/conf/nginx.conf
server {
    listen        80;
server_name example.com *.example.com;
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;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

这样一个简单的nginx反向代理服务器就配置完毕了,启动并查看运行状态

--重新启动
systemctl restart nginx.service
--查看状态
systemctl status nginx.service
[root@centos----20G ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Thu -- :: CST; 4s ago
Process: ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=/SUCCESS)
Process: ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf (code=exited, status=/SUCCESS)
Process: ExecStartPre=/usr/local/nginx/sbin/nginx -t (code=exited, status=/SUCCESS)
Main PID: (nginx)
CGroup: /system.slice/nginx.service
├─ nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
└─ nginx: worker process May :: centos----20G systemd[]: Stopped The nginx HTTP and reverse proxy server.
May :: centos----20G systemd[]: Starting The nginx HTTP and reverse proxy server...
May :: centos----20G nginx[]: nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
May :: centos----20G nginx[]: nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
May :: centos----20G systemd[]: Failed to read PID from file /usr/local/nginx/logs/nginx.pid: Invalid argument
May :: centos----20G systemd[]: Started The nginx HTTP and reverse proxy server.

5、再次部署服务

1、上传FTP源码文件,停掉{sop.tools.service}服务。

##--后台程序重新编译生产
systemctl daemon-reload
##--启动服务
systemctl start sop.tools.service
##--停止服务
systemctl stop sop.tools.service
##--重启服务
systemctl restart sop.tools.service
##--查看服务
systemctl status sop.tools.service ##运行程序
cd /root/sop/tools
dotnet Sop.Tools.dll #运行web应用,这里就是web程序运行的类库 ##其他服务原则上不用停止,只停止Sop.tools.service

操作如下

[root@centos-7-06-64-20G ~]# systemctl status sop.tools.service
● sop.tools.service - Example .NET Web API App running on CentOS
Loaded: loaded (/usr/lib/systemd/system/sop.tools.service; disabled; vendor preset: disabled)
Active: inactive (dead) May 22 12:18:40 centos-7-06-64-20G systemd[1]: Started Example .NET Web API App running on CentOS.
May 22 12:18:41 centos-7-06-64-20G dotnet-sop-tools[27432]: info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
May 22 12:18:41 centos-7-06-64-20G dotnet-sop-tools[27432]: User profile is available. Using '/root/.aspnet/DataProtection-Keys' as ke... rest.
May 22 12:18:41 centos-7-06-64-20G dotnet-sop-tools[27432]: Hosting environment: Production
May 22 12:18:41 centos-7-06-64-20G dotnet-sop-tools[27432]: Content root path: /root/sop/tools
May 22 12:18:41 centos-7-06-64-20G dotnet-sop-tools[27432]: Now listening on: http://[::]:5000
May 22 12:18:41 centos-7-06-64-20G dotnet-sop-tools[27432]: Application started. Press Ctrl+C to shut down.
May 22 12:18:50 centos-7-06-64-20G systemd[1]: Stopping Example .NET Web API App running on CentOS...
May 22 12:18:50 centos-7-06-64-20G dotnet-sop-tools[27432]: Application is shutting down...
May 22 12:18:50 centos-7-06-64-20G systemd[1]: Stopped Example .NET Web API App running on CentOS.
Hint: Some lines were ellipsized, use -l to show in full.
[root@centos-7-06-64-20G ~]# systemctl restart sop.tools.service
[root@centos-7-06-64-20G ~]# systemctl status sop.tools.service
● sop.tools.service - Example .NET Web API App running on CentOS
Loaded: loaded (/usr/lib/systemd/system/sop.tools.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2019-05-22 13:20:51 CST; 3s ago
Main PID: 28333 (dotnet)
CGroup: /system.slice/sop.tools.service
└─28333 /usr/bin/dotnet /root/sop/tools/Sop.Tools.dll May 22 13:20:51 centos-7-06-64-20G systemd[1]: Started Example .NET Web API App running on CentOS.
May 22 13:20:51 centos-7-06-64-20G dotnet-sop-tools[28333]: info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
May 22 13:20:51 centos-7-06-64-20G dotnet-sop-tools[28333]: User profile is available. Using '/root/.aspnet/DataProtection-Keys' as ke... rest.
May 22 13:20:52 centos-7-06-64-20G dotnet-sop-tools[28333]: Hosting environment: Production
May 22 13:20:52 centos-7-06-64-20G dotnet-sop-tools[28333]: Content root path: /root/sop/tools
May 22 13:20:52 centos-7-06-64-20G dotnet-sop-tools[28333]: Now listening on: http://[::]:5000
May 22 13:20:52 centos-7-06-64-20G dotnet-sop-tools[28333]: Application started. Press Ctrl+C to shut down.
Hint: Some lines were ellipsized, use -l to show in full.
[root@centos-7-06-64-20G ~]#

  




 四、总结

到这里就结束了

不足:

对CentOS命令不熟悉

对Tengine和Nginx不太熟悉

这里下次查询资料后在做补充此介绍文档。

相关介绍

  1. 部署资料介绍:https://www.vultr.com/docs/how-to-deploy-a-net-core-web-application-on-centos-7
  2. Nginx配置介绍:http://nginx.org/en/docs/
  3. 部署资料介绍:https://www.danielcrabtree.com/blog/481/how-to-setup-asp-net-core-2-1-on-linux-in-under-10-minutes
  4. 部署资料介绍:https://blog.tekspace.io/hosting-asp-net-core-2-1-application-on-centos-7-with-nginx/
  5. CentOS 7 Systemd介绍:http://www.jinbuguo.com/systemd/systemd.service.html
  6. Tengine 官方详细介绍:http://tengine.taobao.org/document_cn/install_cn.html
  7. Tengine相关介绍https://hacpai.com/article/1536585912527
  8. https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.2
systemctl start sop.tools.service
sop.tools.service

在Linux CentOS上部署Asp.Net Core项目(Tengine、Asp.Net Core、Centos、MySql)的更多相关文章

  1. WTM asp.net core应用程序在Ubuntu上和CentOS上部署

    wtm在Ubuntu上和CentOS上部署 项目发布 在Visual Studio中右击Web项目,选择发布,如下图: Ubuntu安装.net core运行时 Ubuntu我是用的Vmware虚拟机 ...

  2. 如何在Linux服务器上部署禅道

    最近换了新的项目团队,由于新团队比较年轻化,没有实行正规的项目管理,于是我自告奋勇要为团队管理出一份力,帮助团队建立敏捷化的项目管理,经过多方考究和对比后,选择了目前较受欢迎的开源项目管理软件:禅道. ...

  3. 在CentOS上部署kubernetes1.9.0集群

    原文链接: https://jimmysong.io/kubernetes-handbook/cloud-native/play-with-kubernetes.html (在CentOS上部署kub ...

  4. CentOS上部署Django+Nginx+Uwsgi环境

    在CentOS上部署Django+Nginx+Uwsgi环境 奇谭  2016-09-01 评论  Linux  python django nginx uwsgi VirtualEnv的作用:创建隔 ...

  5. Centos 上部署 tomcat7

     在 Centos 上部署 tomcat7 搜索tomcat,选下面红色框框的官网 选箭头指着的版本7, 选 tar.gz 格式, 下载完压缩包,使用 ftpx 工具,放在 centos 的 /opt ...

  6. linux机器上部署多台Tomcat

    在Linux机器上部署多台Tomcat, 我部署的是Tomcat8,只需要一步,即避免端口号冲突. 在解压后的tomcat目录下,修改conf下server.xml. 修改shutdown端口: &l ...

  7. ASP.NET Core学习之四 在CentOS上部署.net core

    一.安装CentOs 以前在大学学过linux,但是对命令行总是有一种深深的排斥感,几年之后,还是又回来了. 1.下载 现在没法FQ,就算是FQ网速也是蜗牛一样慢,我使用阿里云的镜像站进行下载速度还是 ...

  8. So Easy - 在Linux服务器上部署 .NET Core App

    .NET Core 是微软提供的免费.跨平台和开源的开发框架,可以构建桌面应用程序.移动端应用程序.网络应用程序.物联网应用程序和游戏应用程序等.如果你是 Windows 平台下的 dotnet 开发 ...

  9. 在CentOS上部署基于dnx/coreclr的ASP.NET 5应用程序

    在Ubuntu上写好了一个简单的ASP.NET 5应用程序,尝试将这个程序部署在没有mono环境的CentOS服务器上. 部署步骤如下: 1)安装libuv(KestrelHttpServer需要它) ...

随机推荐

  1. 用pyqt5做一个能python程序能插入图片的ide

    之前只是放到github上了,现在一想应该开源,大家想继续做好这个ide的都能从这里起步. #注意在.py文件相同目录下放一个1.png做测试图片 #本质就是用html来实现图片 #写在前面的话:这个 ...

  2. PacBio下机数据如何看?

    一开始拿到三代测序的下机数据时,蒙了,readme ?三代测序的下机数据都有哪些,以及他们具体的格式是怎么样的(以sequel 平台为主). 测序过程 SMRTbell A adapter通用接头,两 ...

  3. 外网不能访问阿里云服务器的apache服务

    今天弄了下Ubuntu的服务器,配置了一个LAMP环境的服务器,配置有时间我再来说 但是配置了很长的时间,差不都怕是好几个小时 在配置apache的时候,出现了问题,好不容易把apache服务配置好 ...

  4. Ehcache配置参数简介

    < defaultCache         maxElementsInMemory = "10000"         maxElementsOnDisk = " ...

  5. test 测试spring容器类

  6. hadoop学习笔记(二):centos7三节点安装hadoop2.7.0

    环境win7+vamvare10+centos7 一.新建三台centos7 64位的虚拟机 master node1 node2 二.关闭三台虚拟机的防火墙,在每台虚拟机里面执行: systemct ...

  7. js正则表达式汇集

    1.只允许中文.字母.数字.中划线.下划线.空格.中文的().英文的()和#,只能以数字.中文.字母.下划线开头,长度为2至40之间 validateTemplateName: function(va ...

  8. Java基础知识学习笔记(一)

    理解面向对象: Java纯粹的面向对象的程序设计语言,主要表现为Java完全支持面向对象的三个基本特征:继承.封装.多态. Java程序的最小单位是类,类代表客观世界中具有某种特征的一类事物,这些类可 ...

  9. c#中关于变量声明那么点事

    class MyVar { /* * 基于安全的考虑,c#变量的初始化有一定的要求 * 1.所有的局部变量在被显示的初始化之前,都会被编译器当作未初始化,然后抛出编译期出错; * 2.所有的字段级变量 ...

  10. modelsim仿真中遇到的问题

    1.modelsim经常遇到数据位宽不相等的情况,这样往往仿真时是不会出数据的,如果用parameter定义了数据的位宽, 要注意实际的位宽数大于parameter定义参数能表示的位宽时,如: par ...