Windows Nginx to service self-boot

Source: Internet
Author: User

1. Download the latest version of the Windows Service Wrapper program

Https://github.com/kohsuke/winsw/releases

2. You can modify its name, for example: Myapp.exe copy the renamed Myapp.exe to the Nginx installation directory

3. Create a Windows Service wrapper XML configuration file under the same Nginx directory, the name must match the name used when the first step is renamed (for example, I am "myapp.xml")

The contents of the Myapp.xml file are as follows:

<configuration>

<!--ID of the service. It should be unique accross the Windows system-->
<id>nginx</id>

<!--Display name of the service-
<name>nginx Service 1.12.2</name>

<!--Service Description-
<description>high Performance Nginx service</description>

<executable>C:\nginx\nginx.exe</executable>

</configuration>

4, under command line, execute the following command to install it as a Windows service.

d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Install

At this point, complete, confirm: My Computer right---management------Is there an nginx? Start Up,

Access http://localhost in the browser confirm, then stop the service, and then visit http://localhost confirm.

Add:
The command format for Windows Servcie wrapper is as follows:

# Installation Services

d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Install

# Uninstall Service

d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Uninstall

# Start Service

d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Start

# Stop Service

d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Stop

Windows Nginx to service self-boot

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.