Installing Nginx as a Windows service self-starting run

Source: Internet
Author: User
Tags nginx server
if Nginx needs to be manually started every time, it is very troublesome, so it is best to set it as Windows System service, boot from boot on the line.

1. Download and modify the operating environment Support program 1), download address: http://ng-srvinst.attron.org/

2), modify the contents of the Ng_srv.xml file:

  1. < Service >
  2. < ID > Nginx ID >
  3. < name > Nginx name >
  4. < Description > Nginx Description >
  5. < executable > D:\www\nginx\nginx.exe executable >
  6. < LogPath > D:\www\logs\ logpath >
  7. < LogMode > Roll logmode >
  8. < depend > depend >
  9. < startargument > - P D:\www\nginx startargument >
  10. < stopargument > - p d:\www\nginx-s Stop stopargument >
  11. Service >

Change the Nginx directory of the above file to the directory where your native nginx resides. My nginx version is 1.6.0 and the modified file is as follows:

  1. < Service >
  2. < ID > Nginx ID >
  3. < name > Nginx name >
  4. < Description > Nginx Description >
  5. < executable > D:\BALANCE_TOMCAT__NGINX\nginx-1.6.0\nginx.exe executable >
  6. < LogPath > D:\BALANCE_TOMCAT__NGINX\nginx-1.6.0\logs\ logpath >
  7. < LogMode > Roll logmode >
  8. < depend > depend >
  9. < startargument > - P D:\BALANCE_TOMCAT__NGINX\nginx-1.6.0 startargument >
  10. < stopargument > - p D:\BALANCE_TOMCAT__NGINX\nginx-1.6.0-s Stop stopargument >
  11. Service >


Note: If you install the service without modifying this file, the service cannot start. The following error will appear:


2. Setup settings for Windows service operations there is a read.me open in the download file as follows:

  1. ng_srv
  2. installation for Nginx server like a serv Ice.
  3. 1. Change in Ng_srv.xml path for your nginx path.
  4. 2. Launch "Ng_srvinst.bat Install" for service installation.
  5. 3. For uninstall launch "Ng_srvinst.bat remove".
  6. thats all.
  7. The directory structure of the

download file is as follows:

Install Ng_srvinst.bat as a system service, such as:


Check if the installation is successful after the installation is complete-& gt; " Service ", you can see that the Nginx service has been successfully installed, such as:



Reference address: http://blog.csdn.net/csfreebird/article/details/ 8751532

Above describes the installation Nginx as a Windows service self-startup run, including aspects of the content, want to be interested in PHP tutorial friends helpful.

  • 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.