Installing Nginx into Windows System services under Windows Server R2

Source: Internet
Author: User

The Web service has been deployed on the Linux platform, but a recent project, which has to be used by Windows, has been forced to look again at Nginx's performance under Windows, because Apache httpd is not really good at windows, and I prefer nginx.

Surprised to find Nginx has stabilized under Windows, so I decided to use Nginx as a Web server.

To the Nginx download page, you can find the corresponding version is available for download: http://nginx.org/en/download.html.

When the download is complete, place it in the specified directory, such as D:\nginx.

To install Nginx as a service, we need to use a software:Windows Service Wrapper, this software is also open source, and has not been updated for a long time, I found the last version is 1.9. Need Baidu.

After downloading, copy the winsw-1.9-bin.exe file to the Nginx WINSW folder (not created).

Create an XML file with the same name,winsw-1.9-bin.xml content as follows:

<?XML version= "1.0" encoding= "UTF-8"?><Service><ID>Nginx</ID><name>Nginx</name><Description>Nginx</Description><executable>D:\nginx\nginx.exe</executable><LogPath>D:\nginx\</LogPath><LogMode>Roll</LogMode><depend></depend><startargument>-P D:\nginx</startargument><stopargument>-P D:\nginx-s Stop</stopargument></Service>

Run cmd as administrator, input:D:\nginx\winsw\winsw-1.9-bin.exeInstall, enter, prompt installation service complete.

At this point, your nginx can be run as a Windows service, you can open the Service Manager to start, stop, modify the automatic or manual operation, etc., you can also use the Windows cmd command:net Start/stop nginx to manage. Isn't it convenient?

I have consulted this article: http://blog.163.com/[email protected]/blog/static/38702877201361952417699/

Installing Nginx into Windows System services under Windows Server R2

Related Article

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.