﻿{"id":1336,"date":"2015-08-05T15:01:20","date_gmt":"2015-08-05T07:01:20","guid":{"rendered":"http:\/\/nick.txtcc.com\/?p=1336"},"modified":"2015-08-05T15:01:20","modified_gmt":"2015-08-05T07:01:20","slug":"set-nginx-as-windows-system-service","status":"publish","type":"post","link":"http:\/\/nick.txtcc.com\/index.php\/linux\/1336","title":{"rendered":"set nginx as Windows system service"},"content":{"rendered":"<ol>\n    <li>Download the latest version of <a href=\"https:\/\/github.com\/kohsuke\/winsw\" rel=\"nofollow\">Windows Service Wrapper<\/a> from <a href=\"http:\/\/repo.jenkins-ci.org\/releases\/com\/sun\/winsw\/winsw\/\" rel=\"nofollow\">here<\/a>.\n<ul>\n    <li><em>Current version as of this writing is <a href=\"http:\/\/repo.jenkins-ci.org\/releases\/com\/sun\/winsw\/winsw\/1.17\/winsw-1.17-bin.exe\" rel=\"nofollow\">v1.17<\/a><\/em>.<\/li>\n<\/ul>\n<\/li>\n    <li>Rename <code>winsw-1.xx-bin.exe<\/code> to something like <code>nginxservice.exe<\/code>.\n<ul>\n    <li><em>This is the name that will show up for the process that owns your nginx process.<\/em><\/li>\n<\/ul>\n<\/li>\n    <li>Place an XML file next to the exe with the same base name, e.g. <code>nginxservice.xml<\/code>. The contents should be like below (verify your nginx location).\n<pre class=\"lang-xml prettyprint-override\"><code>&lt;service&gt;\n  &lt;id&gt;nginx&lt;\/id&gt;\n  &lt;name&gt;nginx&lt;\/name&gt;\n  &lt;description&gt;nginx&lt;\/description&gt;\n  &lt;executable&gt;c:\\nginx\\nginx.exe&lt;\/executable&gt;\n  &lt;logpath&gt;c:\\nginx\\&lt;\/logpath&gt;\n  &lt;logmode&gt;roll&lt;\/logmode&gt;\n  &lt;depend&gt;&lt;\/depend&gt;\n  &lt;startargument&gt;&lt;\/startargument&gt;\n  &lt;stopargument&gt;-s stop&lt;\/stopargument&gt;\n&lt;\/service&gt;\n<\/code><\/pre>\n<ul>\n    <li><em>You can find up to date details about the configuration on the <a href=\"https:\/\/github.com\/kohsuke\/winsw\/blob\/master\/README.markdown#configuration-file-syntax\" rel=\"nofollow\">WinSW README page<\/a><\/em>.<\/li>\n<\/ul>\n<\/li>\n    <li>Run the command <code>nginxservice.exe install<\/code>.<\/li>\n<\/ol>","protected":false},"excerpt":{"rendered":"<p>Download the latest version of Windows Service Wrapper from here. Current version as of this writing&#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,340],"tags":[268,421,17],"class_list":["post-1336","post","type-post","status-publish","format-standard","hentry","category-linux","category-mac-os","tag-nginx","tag-service","tag-windows"],"_links":{"self":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=1336"}],"version-history":[{"count":1,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1336\/revisions"}],"predecessor-version":[{"id":1337,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1336\/revisions\/1337"}],"wp:attachment":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=1336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=1336"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=1336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}