{"id":2016,"date":"2022-11-15T16:11:01","date_gmt":"2022-11-15T08:11:01","guid":{"rendered":"http:\/\/www.tra56.com\/?p=2016"},"modified":"2022-11-15T16:11:01","modified_gmt":"2022-11-15T08:11:01","slug":"2016","status":"publish","type":"post","link":"https:\/\/www.tra56.com\/2016.html","title":{"rendered":"\u5de5\u5177–nssm\u8be6\u89e3 \u4e00\u4e2a\u5f88\u4e0d\u9519\u7684Windows\u670d\u52a1\u5c01\u88c5\u7a0b\u5e8f"},"content":{"rendered":"

\u4e00\u3001nssm\u7b80\u4ecb<\/p>\n

nssm\u662f\u4e00\u4e2a\u670d\u52a1\u5c01\u88c5\u7a0b\u5e8f\uff0c\u5b83\u53ef\u4ee5\u5c06\u666e\u901aexe\u7a0b\u5e8f\u5c01\u88c5\u6210\u670d\u52a1\uff0c\u5b9e\u73b0\u5f00\u673a\u81ea\u542f\u52a8\uff0c\u540c\u7c7b\u578b\u7684\u5de5\u5177\u8fd8\u6709\u5fae\u8f6f\u81ea\u5df1\u7684srvany\uff0c\u4e0d\u8fc7nssm\u66f4\u52a0\u7b80\u5355\u6613\u7528\uff0c\u5e76\u4e14\u529f\u80fd\u5f3a\u5927\u3002<\/p>\n

<\/p>\n

\u5b83\u7684\u7279\u70b9\u5982\u4e0b\uff1a<\/p>\n

<\/p>\n

\u652f\u6301\u666e\u901aexe\u7a0b\u5e8f\uff08\u63a7\u5236\u53f0\u7a0b\u5e8f\u6216\u8005\u5e26\u754c\u9762\u7684Windows\u7a0b\u5e8f\u90fd\u53ef\u4ee5\uff09<\/p>\n

\u5b89\u88c5\u7b80\u5355\uff0c\u4fee\u6539\u65b9\u4fbf<\/p>\n

\u53ef\u4ee5\u81ea\u52a8\u5b88\u62a4\u5c01\u88c5\u4e86\u7684\u670d\u52a1\uff0c\u7a0b\u5e8f\u6302\u6389\u4e86\u540e\u53ef\u4ee5\u81ea\u52a8\u91cd\u542f<\/p>\n

\u5b98\u7f51\u5730\u5740\uff1ahttps:\/\/nssm.cc\/<\/p>\n

<\/p>\n

\u4e8c\u3001nssm\u914d\u7f6e\u8be6\u89e3<\/p>\n

1\u3001\u4e0b\u8f7d\u5730\u5740<\/p>\n

\u5b98\u7f51\u5730\u5740\uff1ahttps:\/\/nssm.cc\/download<\/p>\n

<\/p>\n

\u767e\u5ea6\u7f51\u76d8\uff1ahttps:\/\/pan.baidu.com\/s\/12J0jJF9_7-bstH1eGMI8Lg?pwd=1234<\/p>\n

<\/p>\n

2\u3001\u89e3\u538b\u538b\u7f29\u5305\uff0c\u6839\u636e\u7cfb\u7edf\u4f4d\u6570\u9009\u62e964\u621632\u4f4d\u7a0b\u5e8f<\/p>\n

<\/p>\n

<\/p>\n

3\u3001\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u8fd0\u884cnssm\u7a0b\u5e8f<\/p>\n

\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5207\u6362\u5230nssm.exe\u6240\u5728\u8def\u5f84\uff0c\u8fd0\u884c nssm install\uff0c\u6253\u5f00\u7a0b\u5e8f\u914d\u7f6e\u754c\u9762<\/p>\n

<\/p>\n

\u914d\u7f6e\u9879\u8bf4\u660e\uff1a<\/p>\n

<\/p>\n

Path\uff1a\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u7684\u7a0b\u5e8f<\/p>\n

<\/p>\n

Startup directory\uff1a\u5e94\u7528\u7a0b\u5e8f\u6240\u5728\u7684\u76ee\u5f55<\/p>\n

<\/p>\n

Arguments\uff1a\u5e94\u7528\u8fd0\u884c\u7684\u53c2\u6570<\/p>\n

<\/p>\n

Service name\uff1a\u751f\u6210\u670d\u52a1\u7684\u540d\u79f0<\/p>\n

<\/p>\n

\u6700\u540e\u70b9\u51fbinstall service \u5b8c\u6210windows\u670d\u52a1\u5b89\u88c5\uff0c\u5728windows\u670d\u52a1\u5217\u8868\u5c31\u80fd\u770b\u5230\u521b\u5efa\u7684\u670d\u52a1\u4e86\u3002<\/p>\n

<\/p>\n

4\u3001\u5e38\u7528\u547d\u4ee4<\/p>\n

nssm install servername \/\/\u521b\u5efaservername\u670d\u52a1\uff0c\u5f39\u51fa\u914d\u7f6e\u754c\u9762<\/p>\n

nssm start servername \/\/\u542f\u52a8\u670d\u52a1<\/p>\n

nssm stop servername \/\/\u6682\u505c\u670d\u52a1<\/p>\n

nssm restart servername \/\/\u91cd\u65b0\u542f\u52a8\u670d\u52a1<\/p>\n

nssm remove servername \/\/\u5220\u9664\u521b\u5efa\u7684servername\u670d\u52a1<\/p>\n

nssm edit servername\/\/\u66f4\u6539servername\u670d\u52a1\uff0c\u5f39\u51fa\u4fee\u6539\u754c\u9762<\/p>\n

nssm set servername \u53c2\u6570\u540d \u53c2\u6570\u503c \/\/\u8bbe\u7f6e\u670d\u52a1\u53c2\u6570\u503c<\/p>\n

sc delete servername\/\/windows\u5220\u9664\u670d\u52a1\u547d\u4ee4<\/p>\n

\u76f4\u63a5\u4f7f\u7528windows\u7684\u670d\u52a1\u7ba1\u7406\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u670d\u52a1\u7684\u64cd\u4f5c\uff0c\u670d\u52a1\u53f3\u952e\u5c5e\u6027 - \u6062\u590d\u5373\u53ef\u8bbe\u7f6e\u670d\u52a1\u6302\u6389\u91cd\u542f\u7b49\u5185\u5bb9\u3002<\/p>\n

\u4e09\u3001\u5b9e\u6218\uff1a\u5c06\u5e94\u7528\u505a\u6210\u670d\u52a1<\/p>\n

1\u3001\u7a0b\u5e8f\u8bf4\u660e<\/p>\n

\u8fd9\u91cc\u6f14\u793a\u5c06net6\u7684web\u9879\u76ee\u5236\u4f5c\u6210windows\u670d\u52a1<\/p>\n

<\/p>\n

\u5e94\u7528\u7684\u542f\u52a8\u547d\u4ee4\u662f\uff1adotnet WebApplication_nssm.dll --urls=http:\/\/*:8888\/ --port=8888<\/p>\n

<\/p>\n

2\u3001\u5b89\u88c5\u670d\u52a1<\/p>\n

nssm install<\/pre>\n

Path\uff1aC:\\Program Files\\dotnet\\dotnet.exe<\/p>\n

Startup directory\uff1aD:\\TechLearn\\001\u3001Tools--nssm\\WebApplication_nssm\\bin\\Debug\\net6.0<\/p>\n

Arguments\uff1aWebApplication_nssm.dll --urls=http:\/\/*:8888\/ --port=8888<\/p>\n

Service name\uff1awebapp8888<\/p>\n

\u6700\u540e\u70b9\u51fbinstall service \u5b8c\u6210windows\u670d\u52a1\u5b89\u88c5\uff0c\u5728windows\u670d\u52a1\u5217\u8868\u5c31\u80fd\u770b\u5230\u521b\u5efa\u7684\u670d\u52a1\u4e86\u3002<\/p>\n

<\/p>\n

<\/p>\n

3\u3001\u7ba1\u7406\u670d\u52a1<\/p>\n

\uff081\uff09\u542f\u52a8\u670d\u52a1<\/p>\n

D:\\nssm-2.24\\win64>nssm start webapp8888\r\nwebapp8888: START: \u64cd\u4f5c\u6210\u529f\u5b8c\u6210\u3002<\/pre>\n

<\/p>\n

<\/p>\n

\uff082\uff09\u5173\u95ed\u670d\u52a1<\/h4>\n
D:\\nssm-2.24\\win64>nssm stop webapp8888\r\nwebapp8888: STOP: \u64cd\u4f5c\u6210\u529f\u5b8c\u6210\u3002<\/pre>\n

<\/p>\n

\uff083\uff09\u91cd\u542f\u670d\u52a1<\/h4>\n

\u5982\u679c\u670d\u52a1\u672a\u542f\u52a8\u5c31\u4f1a\u76f4\u63a5\u542f\u52a8\uff0c\u542f\u52a8\u7684\u4f1a\u91cd\u542f\u3002<\/p>\n

D:\\nssm-2.24\\win64>nssm restart webapp8888\r\nwebapp8888: STOP: \u670d\u52a1\u5c1a\u672a\u542f\u52a8\u3002\r\nwebapp8888: START: \u64cd\u4f5c\u6210\u529f\u5b8c\u6210\u3002\r\n\r\nD:\\nssm-2.24\\win64>nssm restart webapp8888\r\nwebapp8888: STOP: \u64cd\u4f5c\u6210\u529f\u5b8c\u6210\u3002\r\nwebapp8888: START: \u64cd\u4f5c\u6210\u529f\u5b8c\u6210\u3002<\/pre>\n

4\uff09\u4fee\u6539\u670d\u52a1<\/h4>\n

\u8f93\u5165\u547d\u4ee4\uff0c\u4fee\u6539\u914d\u7f6e\uff0c\u4e0d\u80fd\u4fee\u6539\u670d\u52a1\u540d<\/p>\n

D:\\nssm-2.24\\win64>nssm edit webapp8888<\/pre>\n

<\/p>\n

5\uff09\u5220\u9664\u670d\u52a1<\/h4>\n

\u5220\u9664\u6709\u4e8c\u6b21\u786e\u8ba4\uff0c\u5220\u9664\u4e4b\u540e\u670d\u52a1\u5c31\u627e\u4e0d\u5230\u4e86\uff0c\u9700\u8981\u91cd\u65b0\u5b89\u88c5<\/p>\n

D:\\nssm-2.24\\win64>nssm remove webapp8888\r\nService "webapp8888" removed successfully!<\/pre>\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e00\u3001nssm\u7b80\u4ecb nssm\u662f\u4e00\u4e2a\u670d\u52a1\u5c01\u88c5\u7a0b\u5e8f\uff0c\u5b83\u53ef\u4ee5\u5c06\u666e\u901aexe\u7a0b\u5e8f\u5c01\u88c5\u6210\u670d\u52a1\uff0c\u5b9e\u73b0\u5f00\u673a\u81ea\u542f\u52a8\uff0c\u540c\u7c7b\u578b\u7684\u5de5\u5177\u8fd8 […]<\/p>\n","protected":false},"author":1,"featured_media":2017,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-2016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-23"],"_links":{"self":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/2016"}],"collection":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/comments?post=2016"}],"version-history":[{"count":1,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/2016\/revisions"}],"predecessor-version":[{"id":2027,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/2016\/revisions\/2027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/media\/2017"}],"wp:attachment":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/media?parent=2016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/categories?post=2016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/tags?post=2016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}