Window how to let Nginx boot from the boot

Source: Internet
Author: User

Installing Nginx

Download the Windows Nginx (Http://nginx.org/download/nginx-1.10.0.zip) and unzip to the location you want to place (D:\xampp\nginx)

Set Nginx as a Windows service

Need to use the "Windows Service Wrapper" gadget, Project address: HTTPS://GITHUB.COM/KOHSUKE/WINSW

: Http://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/1.18/winsw-1.18-bin.exe

After downloading the tool, place it in the Nginx installation directory, rename it to Nginx-service.exe, create the configuration file Nginx-service.xml (the name is the same as the tool name),

Create Nginx-service.exe.config (NET 2.0 runtime is supported by default for NET 4.0 runtime)

The file structure is as follows:

Nginx-service.xml content is as follows:

<service> <id>nginx</id> <name>nginx service</name> <description>high Performan Ce Nginx service</description> <logpath>D:\xampp\nginx\logs</logpath> <log mode= "Roll-by-size" > <sizeThreshold>10240</sizeThreshold> <keepFiles>8</keepFiles> </log> <ex Ecutable>d:\xampp\nginx\nginx.exe</executable> <startarguments>-p D:\xampp\nginx</ Startarguments> <stopexecutable>D:\xampp\nginx\nginx.exe</stopexecutable> <stoparguments>-p D:\xampp\nginx-s stop</stoparguments> </service>

Nginx-service.exe.config content is as follows:

<configuration> <startup> <supportedruntime version= "v2.0.50727"/> <supportedruntime versi on= "v4.0"/> </startup> <runtime> <generatepublisherevidence enabled= "false"/> </runtim E> </configuration>

Run the following command in CMD to install the Windows service

D:\xampp\nginx\nginx-service.exe Install

You can then start the service in the Windows Services panel.

The browser will be able to access the

Website: http://blog.csdn.net/weixin_37288522/article/details/70576409

Window how to let Nginx boot from the 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.