Create a Windows service self-boot for Nginx

Source: Internet
Author: User

1, download the latest version of the Windows Service Wrapper program, such as I download the name is "Winsw-1.9-bin.exe",
Then, name it as you want (for example: "Mynginx.exe", of course, you can also not rename)

2. Copy the downloaded file (winsw-1.9-bin.exe) to the Nginx directory (D:\nginx-1.12.2)

3. Create an XML configuration file for Windows Service wrapper with the same name (Winsw-1.9-bin.xml) under the Nginx directory

The contents of the file are as follows:

<service>  <id>nginx</id>  <name>Nginx Service</name>  <description>High Performance Nginx Service</description>  <logpath>D:\nginx-1.12.2\logs</logpath>  <log mode="roll-by-size">    <sizeThreshold>10240</sizeThreshold>    <keepFiles>8</keepFiles>  </log>  <executable>D:\nginx-1.12.2\nginx.exe</executable>  <startarguments>-p D:\nginx-1.12.2</startarguments>  <stopexecutable>D:\nginx-1.12.2\nginx.exe</stopexecutable>  <stoparguments>-p D:\nginx-1.12.2\ -s stop</stoparguments></service>

Description

<name>Nginx Service</name>        #这是服务里面名字<description>High Performance Nginx Service</description>   #这里是对服务的描述

4. Command line Execution installation command

The command format for Windows Servcie wrapper is as follows:

#安装服务CMD:\> winsw-1.9-bin.exe install#卸载服务CMD:\> winsw-1.9-bin.exe uninstall#启动服务CMD:\> winsw-1.9-bin.exe start#停止服务CMD:\> winsw-1.9-bin.exe stop

#附个当时安装1. Pictures when version 8

Create a Windows service self-boot for Nginx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.