Linux使用.net core

.wiz-editor-body .wiz-code-container { position: relative; padding: 8px 0; margin: 5px 0; text-indent: 0; text-align: left }
.CodeMirror { font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; color: rgba(0, 0, 0, 1); font-size: 0.875rem }
.wiz-editor-body .wiz-code-container .CodeMirror div { margin-top: 0; margin-bottom: 0 }
.CodeMirror-lines { padding: 4px 0 }
.CodeMirror pre.CodeMirror-line, .CodeMirror pre.CodeMirror-line-like { padding: 0 4px }
.CodeMirror pre.CodeMirror-line { min-height: 24px }
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { background-color: rgba(255, 255, 255, 1) }
.CodeMirror-gutters { border-right: 1px solid rgba(221, 221, 221, 1); background-color: rgba(247, 247, 247, 1); white-space: nowrap }
.CodeMirror-linenumbers { }
.CodeMirror-linenumber { padding: 0 3px 0 5px; min-width: 20px; text-align: right; color: rgba(153, 153, 153, 1); white-space: nowrap }
.CodeMirror-guttermarker { color: rgba(0, 0, 0, 1) }
.CodeMirror-guttermarker-subtle { color: rgba(153, 153, 153, 1) }
.CodeMirror-cursor { border-left: 1px solid rgba(0, 0, 0, 1); border-right: none; width: 0 }
.CodeMirror div.CodeMirror-secondarycursor { border-left: 1px solid rgba(192, 192, 192, 1) }
.cm-fat-cursor .CodeMirror-cursor { width: auto; border: 0 !important; background: rgba(119, 238, 119, 1) }
.cm-fat-cursor div.CodeMirror-cursors { z-index: 1 }
.cm-fat-cursor-mark { background-color: rgba(20, 255, 20, 0.5); -webkit-animation: blink 1.06s steps(1) infinite; -moz-animation: blink 1.06s steps(1) infinite; animation: 1.06s step-end infinite blink }
.cm-animate-fat-cursor { width: auto; border: 0; -webkit-animation: blink 1.06s steps(1) infinite; -moz-animation: blink 1.06s steps(1) infinite; animation: 1.06s step-end infinite blink; background-color: rgba(119, 238, 119, 1) }
@-moz-keyframes blink { 0% {} 50% { background-color: transparent; } 100% {}}
@-webkit-keyframes blink { 0% {} 50% { background-color: transparent; } 100% {}}
@keyframes blink { 0% { } 50% { background-color: rgba(0, 0, 0, 0) } 100% { } }
.CodeMirror-overwrite .CodeMirror-cursor { }
.cm-tab { display: inline-block; text-decoration: inherit }
.CodeMirror-rulers { position: absolute; left: 0; right: 0; top: -50px; bottom: -20px; overflow: hidden }
.CodeMirror-ruler { border-left: 1px solid rgba(204, 204, 204, 1); top: 0; bottom: 0; position: absolute }
.cm-s-default .cm-header { color: rgba(0, 0, 255, 1) }
.cm-s-default .cm-quote { color: rgba(0, 153, 0, 1) }
.cm-negative { color: rgba(221, 68, 68, 1) }
.cm-positive { color: rgba(34, 153, 34, 1) }
.cm-header, .cm-strong { font-weight: bold }
.cm-em { font-style: italic }
.cm-link { text-decoration: underline }
.cm-strikethrough { text-decoration: line-through }
.cm-s-default .cm-keyword { color: rgba(119, 0, 136, 1) }
.cm-s-default .cm-atom { color: rgba(34, 17, 153, 1) }
.cm-s-default .cm-number { color: rgba(17, 102, 68, 1) }
.cm-s-default .cm-def { color: rgba(0, 0, 255, 1) }
.cm-s-default .cm-variable, .cm-s-default .cm-punctuation, .cm-s-default .cm-property, .cm-s-default .cm-operator { }
.cm-s-default .cm-variable-2 { color: rgba(0, 85, 170, 1) }
.cm-s-default .cm-variable-3 { color: rgba(0, 136, 85, 1) }
.cm-s-default .cm-comment { color: rgba(170, 85, 0, 1) }
.cm-s-default .cm-string { color: rgba(170, 17, 17, 1) }
.cm-s-default .cm-string-2 { color: rgba(255, 85, 0, 1) }
.cm-s-default .cm-meta { color: rgba(85, 85, 85, 1) }
.cm-s-default .cm-qualifier { color: rgba(85, 85, 85, 1) }
.cm-s-default .cm-builtin { color: rgba(51, 0, 170, 1) }
.cm-s-default .cm-bracket { color: rgba(153, 153, 119, 1) }
.cm-s-default .cm-tag { color: rgba(17, 119, 0, 1) }
.cm-s-default .cm-attribute { color: rgba(0, 0, 204, 1) }
.cm-s-default .cm-hr { color: rgba(153, 153, 153, 1) }
.cm-s-default .cm-link { color: rgba(0, 0, 204, 1) }
.cm-s-default .cm-error { color: rgba(255, 0, 0, 1) }
.cm-invalidchar { color: rgba(255, 0, 0, 1) }
.CodeMirror-composing { border-bottom: 2px solid }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgba(0, 187, 0, 1) }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgba(170, 34, 34, 1) }
.CodeMirror-matchingtag { background: rgba(255, 150, 0, 0.3) }
.CodeMirror-activeline-background { background: rgba(232, 242, 255, 1) }
.CodeMirror { position: relative; background: rgba(245, 245, 245, 1) }
.CodeMirror-scroll { overflow: hidden !important; margin-bottom: 0; margin-right: -30px; padding: 16px 30px 16px 0; outline: none; position: relative }
.CodeMirror-sizer { position: relative; border-right: 30px solid rgba(0, 0, 0, 0) }
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { position: absolute; z-index: 6; display: none }
.CodeMirror-vscrollbar { right: 0; top: 0; overflow-x: hidden; overflow-y: scroll }
.CodeMirror-hscrollbar { bottom: 0; left: 0 !important; overflow-y: hidden; overflow-x: scroll; pointer-events: auto !important; outline: none }
.CodeMirror-scrollbar-filler { right: 0; bottom: 0 }
.CodeMirror-gutter-filler { left: 0; bottom: 0 }
.CodeMirror-gutters { position: absolute; left: 0; top: 0; min-height: 100%; z-index: 3 }
.CodeMirror-gutter { white-space: normal; height: 100%; display: inline-block; vertical-align: top; margin-bottom: -30px }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: none !important; border: none !important }
.CodeMirror-gutter-background { position: absolute; top: 0; bottom: 0; z-index: 4 }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4 }
.CodeMirror-gutter-wrapper ::selection { background-color: rgba(0, 0, 0, 0) }
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: rgba(0, 0, 0, 0) }
.CodeMirror-lines { cursor: text; min-height: 1px }
.CodeMirror pre.CodeMirror-line, .CodeMirror pre.CodeMirror-line-like { -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; border-width: 0; background: rgba(0, 0, 0, 0); font-family: inherit; font-size: inherit; margin: 0; white-space: pre; word-wrap: normal; line-height: inherit; color: inherit; z-index: 2; position: relative; overflow: visible; -webkit-tap-highlight-color: transparent; -webkit-font-variant-ligatures: contextual; font-variant-ligatures: contextual }
.CodeMirror-wrap pre.CodeMirror-line, .CodeMirror-wrap pre.CodeMirror-line-like { word-wrap: break-word; white-space: pre-wrap; word-break: normal }
.CodeMirror-linebackground { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 0 }
.CodeMirror-linewidget { position: relative; z-index: 2; padding: 0.1px }
.CodeMirror-widget { }
.CodeMirror-rtl pre { direction: rtl }
.CodeMirror-code { outline: none }
.CodeMirror-scroll, .CodeMirror-sizer, .CodeMirror-gutter, .CodeMirror-gutters, .CodeMirror-linenumber { -moz-box-sizing: content-box; box-sizing: content-box }
.CodeMirror-measure { position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden }
.CodeMirror-cursor { position: absolute; pointer-events: none }
.CodeMirror-measure pre { position: static }
div.CodeMirror-cursors { visibility: hidden; position: relative; z-index: 3 }
div.CodeMirror-dragcursors { visibility: visible }
.CodeMirror-focused div.CodeMirror-cursors { visibility: visible }
.CodeMirror-selected { background: rgba(217, 217, 217, 1) }
.CodeMirror-focused .CodeMirror-selected { background: rgba(215, 212, 240, 1) }
.CodeMirror-crosshair { cursor: crosshair }
.CodeMirror-line::selection, .CodeMirror-line>span::selection, .CodeMirror-line>span>span::selection { background: rgba(215, 212, 240, 1) }
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: rgba(215, 212, 240, 1) }
.cm-searching { background: rgba(255, 255, 0, 0.4) }
.cm-force-border { padding-right: 0.1px }
@media print { .CodeMirror div.CodeMirror-cursors { visibility: hidden } }
.cm-tab-wrap-hack:after { content: "" }
span.CodeMirror-selectedtext { background: none }
.CodeMirror-activeline-background, .CodeMirror-selected { transition: visibility 0ms 100ms }
.CodeMirror-blur .CodeMirror-activeline-background, .CodeMirror-blur .CodeMirror-selected { visibility: hidden }
.CodeMirror-blur .CodeMirror-matchingbracket { color: inherit !important; outline: none !important; text-decoration: none !important }
.CodeMirror-sizer { }
.cm-s-tomorrow-night-eighties.CodeMirror { background: rgba(0, 0, 0, 1); color: rgba(204, 204, 204, 1) }
.cm-s-tomorrow-night-eighties div.CodeMirror-selected { background: rgba(45, 45, 45, 1) }
.cm-s-tomorrow-night-eighties .CodeMirror-line::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line>span::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::selection { background: rgba(45, 45, 45, 0.99) }
.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99) }
.cm-s-tomorrow-night-eighties .CodeMirror-gutters { background: rgba(0, 0, 0, 1); border-right: 0 }
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: rgba(242, 119, 122, 1) }
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: rgba(119, 119, 119, 1) }
.cm-s-tomorrow-night-eighties .CodeMirror-linenumber { color: rgba(81, 81, 81, 1) }
.cm-s-tomorrow-night-eighties .CodeMirror-cursor { border-left: 1px solid rgba(106, 106, 106, 1) }
.cm-s-tomorrow-night-eighties span.cm-comment { color: rgba(210, 123, 83, 1) }
.cm-s-tomorrow-night-eighties span.cm-atom { color: rgba(161, 106, 148, 1) }
.cm-s-tomorrow-night-eighties span.cm-number { color: rgba(161, 106, 148, 1) }
.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute { color: rgba(153, 204, 153, 1) }
.cm-s-tomorrow-night-eighties span.cm-keyword { color: rgba(242, 119, 122, 1) }
.cm-s-tomorrow-night-eighties span.cm-string { color: rgba(255, 204, 102, 1) }
.cm-s-tomorrow-night-eighties span.cm-variable { color: rgba(153, 204, 153, 1) }
.cm-s-tomorrow-night-eighties span.cm-variable-2 { color: rgba(102, 153, 204, 1) }
.cm-s-tomorrow-night-eighties span.cm-def { color: rgba(249, 145, 87, 1) }
.cm-s-tomorrow-night-eighties span.cm-bracket { color: rgba(204, 204, 204, 1) }
.cm-s-tomorrow-night-eighties span.cm-tag { color: rgba(242, 119, 122, 1) }
.cm-s-tomorrow-night-eighties span.cm-link { color: rgba(161, 106, 148, 1) }
.cm-s-tomorrow-night-eighties span.cm-error { background: rgba(242, 119, 122, 1); color: rgba(106, 106, 106, 1) }
.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background { background: rgba(52, 54, 0, 1) }
.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: rgba(255, 255, 255, 1) !important }
html, .wiz-editor-body { font-size: 12pt }
.wiz-editor-body { font-family: Helvetica, "Hiragino Sans GB", "微软雅黑", "Microsoft YaHei UI", SimSun, SimHei, arial, sans-serif; line-height: 1.7; margin: 0 auto; position: relative; padding: 20px 16px }
.wiz-editor-body h1, .wiz-editor-body h2, .wiz-editor-body h3, .wiz-editor-body h4, .wiz-editor-body h5, .wiz-editor-body h6 { margin: 1.25rem 0 0.625rem; padding: 0; font-weight: bold }
.wiz-editor-body h1 { font-size: 1.67rem }
.wiz-editor-body h2 { font-size: 1.5rem }
.wiz-editor-body h3 { font-size: 1.25rem }
.wiz-editor-body h4 { font-size: 1.17rem }
.wiz-editor-body h5 { font-size: 1rem }
.wiz-editor-body h6 { font-size: 1rem; color: rgba(119, 119, 119, 1); margin: 1rem 0 }
.wiz-editor-body div, .wiz-editor-body p, .wiz-editor-body ul, .wiz-editor-body ol, .wiz-editor-body dl, .wiz-editor-body li { margin: 8px 0 0 }
.wiz-editor-body blockquote, .wiz-editor-body table, .wiz-editor-body pre, .wiz-editor-body code { margin: 8px 0 }
.wiz-editor-body .CodeMirror pre { margin: 0 }
.wiz-editor-body a { word-wrap: break-word; text-decoration-skip-ink: none }
.wiz-editor-body ul, .wiz-editor-body ol { padding-left: 2rem }
.wiz-editor-body ol.wiz-list-level1>li { list-style-type: decimal }
.wiz-editor-body ol.wiz-list-level2>li { list-style-type: lower-latin }
.wiz-editor-body ol.wiz-list-level3>li { list-style-type: lower-roman }
.wiz-editor-body li.wiz-list-align-style { list-style-position: inside; margin-left: -1em }
.wiz-editor-body blockquote { padding: 0 12px }
.wiz-editor-body blockquote>:first-child { margin-top: 0 }
.wiz-editor-body blockquote>:last-child { margin-bottom: 0 }
.wiz-editor-body img { border: 0; max-width: 100%; height: auto !important; margin: 2px 0; padding: 2px; vertical-align: bottom }
.wiz-editor-body table { border-collapse: collapse; border: 1px solid rgba(167, 175, 188, 1) }
.wiz-editor-body td, .wiz-editor-body th { padding: 4px 8px; border-collapse: collapse; border: 1px solid rgba(167, 175, 188, 1); min-height: 28px; box-sizing: border-box }
.wiz-editor-body td>div:first-child { margin-top: 0 }
.wiz-editor-body td>div:last-child { margin-bottom: 0 }
.wiz-editor-body img.wiz-svg-image { box-shadow: 1px 1px 4px rgba(232, 232, 232, 1) }
.wiz-editor-body .wiz-image-container { margin: 0; max-width: 100%; display: inline-flex; flex-direction: column }
.wiz-editor-body .wiz-image-container .wiz-image-title { display: inline-block; text-align: center; color: rgba(167, 175, 188, 1); line-height: 18px; font-size: 12px; min-height: 18px; width: 100%; white-space: normal }
.wiz-hide { display: none !important }
.wiz-editor-body.wiz-editor-outline { padding-right: 0; padding-left: 0 }
.wiz-editor-body.wiz-editor-outline .outline-container { margin: 0; padding: 0; line-height: 1.5 }
.wiz-editor-body.wiz-editor-outline .outline-container div { margin: 0 }
.wiz-editor-body.wiz-editor-outline .node { margin: 0; padding: 0 }
.wiz-editor-body.wiz-editor-outline .outline-container>.node { margin-right: 24px; margin-left: 30px }
.wiz-editor-body.wiz-editor-outline .node.collapsed .children { display: none }
.wiz-editor-body.wiz-editor-outline .node .row { position: relative; padding-left: 26px }
.wiz-editor-body.wiz-editor-outline .node .operator-container { width: 36px; position: absolute; top: 4px; left: -18px }
.wiz-editor-body.wiz-editor-outline .node .operator-bar { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center }
.wiz-editor-body.wiz-editor-outline .node .switch { width: 18px; height: 18px; display: flex; flex-direction: column; align-items: center; overflow: hidden }
.wiz-editor-body.wiz-editor-outline .node .switch i { font-size: 20px; position: relative; left: -1px; top: -1px }
.wiz-editor-body.wiz-editor-outline .node .switch.active { cursor: pointer; color: rgba(0, 0, 0, 0); transition: transform 200ms ease 0s }
.wiz-editor-body.wiz-editor-outline .node.collapsed .switch.active { transform: rotateY(-90deg) }
.wiz-editor-body.wiz-editor-outline .node .row:hover .switch.active { color: rgba(80, 95, 121, 1) }
.wiz-editor-body.wiz-editor-outline .node .dot { display: flex; align-items: center; justify-content: center; border-radius: 100%; width: 18px; height: 18px }
.wiz-editor-body.wiz-editor-outline .node.collapsed .dot { background-color: rgba(80, 95, 121, 0.15) }
.wiz-editor-body.wiz-editor-outline .node .dot-icon { background-color: rgba(80, 95, 121, 1); border-radius: 100%; width: 6px; height: 6px }
.wiz-editor-body.wiz-editor-outline .node .child { margin-left: 8px; border-left: 1px solid rgba(230, 233, 237, 1); padding-left: 17px }
.wiz-editor-body.wiz-editor-outline .node .content { flex: 1; outline: none; padding: 4px 0 }
.wiz-editor-body.wiz-editor-outline .node div.content { font-size: 1rem }
.wiz-editor-body.wiz-editor-outline .node.complete>.row .content { text-decoration: line-through; color: rgba(167, 175, 188, 1) }
.wiz-editor-body.wiz-editor-outline .node .notes { outline: none; font-size: 0.8rem; color: rgba(167, 175, 188, 1) }
.wiz-editor-body.wiz-editor-outline .node .image { outline: none; padding-top: 4px; padding-bottom: 4px }
.wiz-editor-body.wiz-editor-outline .outline-container h1, .wiz-editor-body.wiz-editor-outline .outline-container h2, .wiz-editor-body.wiz-editor-outline .outline-container h3, .wiz-editor-body.wiz-editor-outline .outline-container h4, .wiz-editor-body.wiz-editor-outline .outline-container h5, .wiz-editor-body.wiz-editor-outline .outline-container h6 { margin: 0 }
body, .wiz-editor-body { padding-left: 48px; padding-right: 48px }

安装nginx
yum install nginx

 
 
 
 
 

1
 
 
 
 
 
1
yum install nginx
 
 
查看nginx是否安装成功
nginx -t

 
 
 
 
 

1
 
 
 
 
 
1
nginx -t
 
 
查看nginx版本
nginx -v

 
 
 
 
 

1
 
 
 
 
 
1
nginx -v
 
 
查看nginx安装目录
rpm -ql nginx

 
 
 
 
 

1
 
 
 
 
 
1
rpm -ql nginx
 
 
启动nginx
// 查看安装目录
rpm -ql nginx

// 得到nginx目录

cd /usr/sbin

./nginx

 
 
 
 
 

8
 
 
 
 
 
1
// 查看安装目录
2
rpm -ql nginx 
3

4
// 得到nginx目录
5

6
cd /usr/sbin
7

8
./nginx
 
 
配置开机自启
vim /etc/rc.d/rc.local

添加
#开机自启
/usr/sbin/nginx

 
 
 
 
 

5
 
 
 
 
 
1
vim /etc/rc.d/rc.local
2

3
添加
4
#开机自启
5
/usr/sbin/nginx
 
 
安装.net core runtime
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm

// 安装包含asp net core的运行时
sudo yum install aspnetcore-runtime-5.0

 
 
 
 
 

4
 
 
 
 
 
1
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
2

3
// 安装包含asp net core的运行时
4
sudo yum install aspnetcore-runtime-5.0
 
 
安装sqlserver
// 下载微软yum源
wget -O /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
// 安装 sqlserver
yum install -y mssql-server

 
 
 
 
 

4
 
 
 
 
 
1
// 下载微软yum源
2
wget -O /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
3
// 安装 sqlserver
4
yum install -y mssql-server
 
 
服务器可用内存小于2g
// 破解限制
//首先切换到 /opt/mssql/bin 目录下
cd /opt/mssql/bin/
// 然后保存备份文件
mv sqlservr sqlservr.old

//使用python修改二进制文件,把里面的2G内存限制改为512M

python

oldfile = open("sqlservr.old", "rb").read()

newfile = oldfile.replace("\x00\x94\x35\x77", "\x00\x80\x84\x1e")

open("sqlservr", "wb").write(newfile)

exit()

 
 
 
 
 

17
 
 
 
 
 
1
// 破解限制
2
//首先切换到 /opt/mssql/bin 目录下
3
cd /opt/mssql/bin/
4
// 然后保存备份文件
5
    mv sqlservr sqlservr.old
6

7
//使用python修改二进制文件,把里面的2G内存限制改为512M
8

9
python 
10

11
oldfile = open("sqlservr.old", "rb").read()
12

13
newfile = oldfile.replace("\x00\x94\x35\x77", "\x00\x80\x84\x1e")
14

15
open("sqlservr", "wb").write(newfile)
16

17
exit()
 
 
选择sqlserver版本,并设置sa账号密码
// 终端内输入
/opt/mssql/bin/mssql-conf setup

// 显示以下内容
Choose an edition of SQL Server:
1) Evaluation (free, no production use rights, 180-day limit)
2) Developer (free, no production use rights)
3) Express (free)
4) Web (PAID)
5) Standard (PAID)
6) Enterprise (PAID)
7) Enterprise Core (PAID)
8) I bought a license through a retail sales channel and have a product key to enter.

//输入3(免费版本)

 
 
 
 
 

15
 
 
 
 
 
1
// 终端内输入
2
/opt/mssql/bin/mssql-conf setup
3

4
// 显示以下内容
5
Choose an edition of SQL Server:
6
  1) Evaluation (free, no production use rights, 180-day limit)
7
  2) Developer (free, no production use rights)
8
  3) Express (free)
9
  4) Web (PAID)
10
  5) Standard (PAID)
11
  6) Enterprise (PAID)
12
  7) Enterprise Core (PAID)
13
  8) I bought a license through a retail sales channel and have a product key to enter.
14

15
      //输入3(免费版本)
 
 
检测sql server是否安装成功
systemctl status mssql-server

 
 
 
 
 

1
 
 
 
 
 
1
systemctl status mssql-server
 
 
配置Nginx
// Nginx目录

/usr/local/nginx

 
 
 
 
 

3
 
 
 
 
 
1
// Nginx目录
2

3
 /usr/local/nginx
 
 
给程序权限否则无法运行
chmod 777 文件名称

./程序名

 
 
 
 
 

3
 
 
 
 
 
1
chmod 777 文件名称
2

3
./程序名
 
 

linux需要安装libgdiplus否则qrcode(二维码)无法使用

yum install libgdiplus

 
 
 
 
 

1
 
 
 
 
 
1
yum install libgdiplus
 
 

监视应用,进程守护

// 创建服务文件
sudo nano /etc/systemd/system/kestrel-NetWebGta.service

// 输入
[Unit]
Description=Example .NET Web API App running on Ubuntu

[Service]
WorkingDirectory=/var/www/你的目录
ExecStart=/usr/bin/dotnet /var/www/你的目录/你的网站.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-example
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target
// 按ctrl+x退出

// 启动服务
sudo systemctl start kestrel-NetWebGta.service

// 查看服务状态
sudo systemctl status kestrel-NetWebGta.service

# 立即启动一个服务
$ sudo systemctl start kestrel-NetWebGta.service

# 立即停止一个服务
$ sudo systemctl stop kestrel-NetWebGta.service

# 重启一个服务
$ sudo systemctl restart kestrel-NetWebGta.service

 
 
 
 
 

39
 
 
 
 
 
1
// 创建服务文件
2
sudo nano /etc/systemd/system/kestrel-NetWebGta.service
3

4

5
// 输入
6
[Unit]
7
Description=Example .NET Web API App running on Ubuntu
8

9
[Service]
10
WorkingDirectory=/var/www/你的目录
11
ExecStart=/usr/bin/dotnet /var/www/你的目录/你的网站.dll
12
Restart=always
13
# Restart service after 10 seconds if the dotnet service crashes:
14
RestartSec=10
15
KillSignal=SIGINT
16
SyslogIdentifier=dotnet-example
17
User=root
18
Environment=ASPNETCORE_ENVIRONMENT=Production
19
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
20

21
[Install]
22
WantedBy=multi-user.target
23
// 按ctrl+x退出
24

25
// 启动服务
26
sudo systemctl start kestrel-NetWebGta.service
27

28
// 查看服务状态
29
sudo systemctl status kestrel-NetWebGta.service
30

31
# 立即启动一个服务
32
$ sudo systemctl start kestrel-NetWebGta.service
33

34
# 立即停止一个服务
35
$ sudo systemctl stop kestrel-NetWebGta.service
36

37
# 重启一个服务
38
$ sudo systemctl restart kestrel-NetWebGta.service
39

 
 

Linux使用.net core的更多相关文章

  1. debian(kali Linux) 安装net Core

    debian(kali Linux) 安装net Core curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-previ ...

  2. linux下生成core dump文件方法及设置

    linux下生成core dump文件方法及设置    from:http://www.cppblog.com/kongque/archive/2011/03/07/141262.html core ...

  3. 什么是core dump linux下用core和gdb查询出现"段错误"的地方

    什么是core dump   linux下用core和gdb查询出现"段错误"的地方 http://blog.chinaunix.net/uid-26833883-id-31932 ...

  4. linux下用core和gdb查询出现"段错误"的地方【转】

    转自:http://blog.chinaunix.net/uid-30091091-id-5754288.html 原文地址:linux下用core和gdb查询出现"段错误"的地方 ...

  5. 发布项目到 Linux 上运行 Core 项目

    发布项目到 Linux 上运行 Core 项目 目录索引 [无私分享:ASP.NET CORE 项目实战]目录索引 简介 ASP.Net Core 给我们带来的最大的亮点就是跨平台,我在我电脑(win ...

  6. Visual Studio 2017 通过SSH 调试Linux 上.NET Core

    Visual Studio 2017 通过SSH 调试Linux 上.NET Core 应用程序. 本文环境 开发环境:Win10 x64 Visual Studio 2017 部署环境:Ubuntu ...

  7. Linux安装NET CORE

    Linux安装.NET CORE 1.Add the dotnet apt-get feed 为了在Ubuntu或Linux Mint上安装.NET,您需要首先设置托管所需软件包的apt-get fe ...

  8. Linux系统打开core dump的配置【转】

    什么是core dump core dump又叫核心转储, 当程序运行过程中发生异常, 程序异常退出时, 由操作系统把程序当前的内存状况存储在一个core文件中, 叫core dump.core du ...

  9. 在Linux上利用core dump和GDB调试

    段错误(segfault) "段错误"是程序试图操作不允许访问或试图访问的不允许内存的情况.可能导致段错误的原因主要有: 1.试图解引用空指针(你不允许访问内存地址0) 2.试图解 ...

  10. Linux中生成Core Dump系统异常信息记录文件的教程

    Linux中生成Core Dump系统异常信息记录文件的教程 http://www.jb51.net/LINUXjishu/473351.html

随机推荐

  1. mysql存储过程取得错误信息的方式。

    GET DIAGNOSTICS CONDITION 1 @v_sqlstate=RETURNED_SQLSTATE,@v_message= MESSAGE_TEXT; SELECT @v_sqlsta ...

  2. 巧用 CSS 实现高频出现的复杂怪状按钮 - 镂空的内凹圆角边框

    在之前,我们有些过这么一篇文章 - 使用 CSS 轻松实现高频出现的各类奇形怪状按钮. 里面包含了如下这些图形: 你可以在这里看到:CodePen Demo -- CSS Various Button ...

  3. 一种基于Nginx的热点数据调度处理方法

    本文分享自天翼云开发者社区<一种基于Nginx的热点数据调度处理方法>,作者:康****彬 一.应用场景 基于Nginx的热点数据调度处理,热点节点数据负载均衡处理,减少热点节点压力,提高 ...

  4. IDEA 接入 DeepSeek,太酷了!

    你好,我是 Guide.前两天,我发文提到 DeepSeek 的回答推荐了我的资料 <JavaGuide 面试突击版>(PDF):DeepSeek 的这波回答我给满分!. 这篇文章简单介绍 ...

  5. Linux安装Kafka(依赖zookeeper)

    一.版本 kafka:kafka_2.12-2.4.0 zk:zookeeper-3.4.14 二.单机版安装 修改 server.properties ,支持外网访问 [1]创建日志文件夹: mkd ...

  6. Luogu P3177 树上染色 [ 蓝 ] [ 树形 dp ] [ 贡献思维 ]

    一道很好的树形 dp !!!!! 树上染色. 错误思路 定义 \(dp[u][i]\) 表示以 \(u\) 为根的子树中,把 \(i\) 个点染成黑色的最大收益. 但这样写,就在转移的时候必须枚举每一 ...

  7. JAVA运算符及实例

    JAVA语言支持以下运算符 优先级() 算数运算符:+,-,*,/,%,++,-- 实例1:  package operator; ​ public class Demo01 {     public ...

  8. flutter ios 深色模式下状态栏文字是白色的,白色背景下看不见

    flutter ios 深色模式下状态栏文字是白色的,白色背景下看不见 theme: ThemeData( appBarTheme: const AppBarTheme( systemOverlayS ...

  9. 面试官:谈谈RabbitMQ的队头阻塞问题?

    RabbitMQ 延迟消息的队头阻塞问题是指,在使用死信队列(DLX)和 TTL(消息过期时间)实现延迟消息时,由于队列的先进先出(FIFO)特性,在队列头部消息未过期的情况下,即使后续消息已经过期也 ...

  10. IDEA - 文件上方的文档注释如何自定义

    1.在设置中打开文件和代码模板,根据描述中的参考信息进行自定义配置 File > Settings > Editor > File and Code Templates 2.配置完成 ...