在 CentOS 7(Linux)上部署ASP.NET Core 2.2 Web应用程序(Tengine、Asp.Net Core MVC、Centos 7、MySql)
一、前言
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
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不太熟悉
这里下次查询资料后在做补充此介绍文档。
相关介绍
- 部署资料介绍:https://www.vultr.com/docs/how-to-deploy-a-net-core-web-application-on-centos-7
- Nginx配置介绍:http://nginx.org/en/docs/
- 部署资料介绍:https://www.danielcrabtree.com/blog/481/how-to-setup-asp-net-core-2-1-on-linux-in-under-10-minutes
- 部署资料介绍:https://blog.tekspace.io/hosting-asp-net-core-2-1-application-on-centos-7-with-nginx/
- CentOS 7 Systemd介绍:http://www.jinbuguo.com/systemd/systemd.service.html
- Tengine 官方详细介绍:http://tengine.taobao.org/document_cn/install_cn.html
- Tengine相关介绍https://hacpai.com/article/1536585912527
- 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
在 CentOS 7(Linux)上部署ASP.NET Core 2.2 Web应用程序(Tengine、Asp.Net Core MVC、Centos 7、MySql)的更多相关文章
- 【软件安装】在 CentOS 7(Linux)上部署流媒体服务(Tengine、ffmpeg、Centos 7、nginx-http-flv-module、OBS)
Centos7+Tengine+Nginx-http-flv-module+ffmpeg+OBS搭建流媒体服务器 一.需求和背景 视频直播是基于领先的内容接入.分发网络和大规模分布式实时转码技术打造的 ...
- Linux上部署web服务器并发布web项目-转
Linux上部署web服务器并发布web项目 近在学习如何在linux上搭建web服务器来发布web项目,由于本人是linux新手,所以中间入了不少坑,搞了好久才搞出点成果.以下是具体的详细步骤以 ...
- Linux上部署SVN
Linux上部署SVN author:headsen chen 2017-10-16 16:45:04 前提:通过yum来安装,必须是centos6.5的桌面版的.否则会出现某些的安装包不全而导致 ...
- 在Linux上部署Web项目
You believe it or not there is a feeling, lifetime all not lost to time. 在Linux上部署Web项目 这个是普通的web项目, ...
- Linux上部署多个tomcat端口设置
在Linux上部署多个tomcat主要是防止端口冲突的问题, tomcat服务器需配置三个端口才能启动,安装时默认启用了这三个端口,当要运行多个tomcat服务时需要修改这三个端口,不能相同.端口一: ...
- 在linux上部署tomcat服务
在linux上部署tomcat 1.安装JDK 2.下载tomcat http://tomcat.apache.org/download-70.cgi 3.上传到服务器,并解压 4.上传war包或者已 ...
- 一、netcore跨平台之 Linux上部署netcore和webapi
这几天闲着的时候在linux上部署了一下netcore webapi,下面就纪要一下这个过程. 中间遇到不少的坑,心里都是泪啊. 话不多说,开始干活. ------------------------ ...
- Dubbo入门到精通学习笔记(二):Dubbo管理控制台、使用Maven构建Dubbo的jar包、在Linux上部署Dubbo privider服务(shell脚本)、部署consumer服务
文章目录 Dubbo管理控制台 1.Dubbo管理控制台的主要作用: 2.管理控制台主要包含: 3.管理控制台版本: 安装 Dubbo 管理控制台 使用Maven构建Dubbo服务的可执行jar包 D ...
- 在linux上部署自己开发的web项目
在linux上部署自己开发的web项目 前言:相信有很多做开发的小伙伴和我之前一样,只会在windows环境下,利用开发工具开发运行web项目,但是却不知道怎么把开发好的项目部署到linux服务器上去 ...
随机推荐
- 程序员必须掌握的Java 框架,小白学会之后15k不是问题
Spring 的核心特性是什么?Spring 优点? Spring 的核心是控制反转(IoC)和面向切面(AOP) Spring 优点: 程序员必须掌握的Java 框架,学会之后50k不是问题 (1) ...
- Swagger之外的选择
今天给大家安利一款接口文档生成器--JApiDocs. swagger想必大家都用过吧,非常方便,功能也十分强大.如果要说swaager有什么缺点,想必就是注解写起来比较麻烦.如果我说有一款不用写注解 ...
- oracle自定义split分割函数
函数如下: create or replace FUNCTION fn_rme_split(p_str IN VARCHAR2, p_delimiter IN VARCHAR2) RETURN rme ...
- 手把手教你使用Python抓取QQ音乐数据(第二弹)
[一.项目目标] 通过Python爬取QQ音乐数据(一)我们实现了获取 QQ 音乐指定歌手单曲排行指定页数的歌曲的歌名.专辑名.播放链接. 此次我们在之前的基础上获取QQ音乐指定歌曲的歌词及前15个精 ...
- 重学ASP.NET Core 中的标记帮助程序
标记帮助程序是什么 标记帮助程序使服务器端代码可以在 Razor 文件中参与创建和呈现 HTML 元素. 例如,内置的 ImageTagHelper 可以将版本号追加到图片名称. 每当图片发生变化时 ...
- 1166 - Unknown error 1166[mysql 错误
错误码 1166 原因 字段名因为是复制过来的, 末尾存在了一个空格换行
- myeclipse集成jad反编译步骤
(1) 将jad.exe放到java的jdk\bin目录下(2) 将jadeclipse插件net.sf.jadclipse_3.3.0.jar 拷贝到myeclipse安装目\Common\plug ...
- javamelody对Java Application进行监控
前面写过对于webapp,用javamelody来监控.分析性能是挺方便的:那要对普通的java应用进行监控,只需要在应用上启动一个嵌入式web容器就可以了. javamelody里面的war包就用了 ...
- 【贪心】Emergency Evacuation
题目 大致题意 把指定的人从同一出口送出车外,且同一位置不能同时有两个人,求所需的最短时间. 分析 第一感觉就是利用贪心思想解决问题,但是这道题的数据范围用模拟的话肯定是会爆掉的,所以这是不可取的.我 ...
- 深入理解JVM(③)Java模块化系统
前言 JDK9引入的Java模块化系统(Java Platform Module System ,JPMS)是 对Java技术的一次重要升级,除了像之前JAR包哪有充当代码的容器之外,还包括: 依赖其 ...