Install nginx as a Windows Service

Source: Internet
Author: User

The target system for installation is Windows 7.

First read this articleArticle: Http://blog.csdn.net/defonds/article/details/7906005

Winsw is recommended as the registration service tool, which is indeed good. The project home page is at: https://github.com/kohsuke/winsw

You can simply download an EXE file and rename it install.exe. Then, create an install. xml file and complete the settings on the homepage.

The operation is successful. But not in newlispProgramAlways report the following error

 
Annot start service from the command line or a debugger...

However, intallutil.exe brought by .netdoes not work. The following error occurs:

 
Exception occurred while initializing the installation: system. badimageformatexception: cocould not load file or assembly 'file: // C: \ cloud_engine \ nginx \ nginx.exe 'or one of its dependencies. the module was expected to contain an assembly manifest ..

Finally found this: http://ng-srvinst.attron.org/

Download the compressed package, decompress it, and check read. Me. It is very simple.

However, pay attention to the last two configuration items in the ng_srv.xml file:

 
<Service> <ID> nginx </ID> <Name> nginx </Name> <description> nginx </description> <executable> cloud-engine-home \ nginx \ nginx.exe </executable> <logpath> cloud-engine-home \ nginx \ logs \ </logpath> <logmode> Roll </logmode> <depend> </depend> <startargument>-P cloud-engine-home \ nginx </startargument> <stopargument>-P cloud-engine-home \ nginx-S Stop </stopargument> </service>

-P is followed by the nginxdirectory. If it is written into the nginx.exe path, the nginx service cannot be started.

Now newlisp is successfully called through exec.

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.