Install Nginx and run it as a Windows service

Source: Internet
Author: User
: This article describes how to install Nginx as a Windows service and run it on your own. For more information about PHP tutorials, see. If Nginx needs to be manually started every time it is used, it is really troublesome, so it is best to set it as a Windows system service and start it on your own.

1. download and modify the running environment support program 1),: http://ng-srvinst.attron.org/

2) modify the content of the ng_srv.xml file:

  1. Nginx
  2. Nginx
  3. Nginx
  4. D: \ www \ nginx \ nginx.exe
  5. D: \ www \ logs \
  6. Roll
  7. -P d: \ www \ nginx
  8. -P d: \ www \ nginx-s stop

Change the Nginx Directory of the above file to the directory where your local Nginx is located. My Nginx version is 1.6.0. the modified file is as follows:

  1. Nginx
  2. Nginx
  3. Nginx
  4. D: \ BALANCE_TOMCAT__NGINX \ nginx-1.6.0 \ nginx.exe
  5. D: \ BALANCE_TOMCAT__NGINX \ nginx-1.6.0 \ logs \
  6. Roll
  7. -P D: \ BALANCE_TOMCAT__NGINX \ nginx-1.6.0
  8. -P D: \ BALANCE_TOMCAT__NGINX \ nginx-1.6.0-s stop


Note: If this file is not modified, the service will be installed and cannot be started. The following error occurs:


2. set the installer to Windows service operations In the downloaded file, read. me is opened as follows:

  1. NG_SRV
  2. Installation for nginx server like a service.
  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.

The directory structure of the downloaded file is as follows:

Install ng_srvinst.bat as a system service, for example:


After the installation is complete, check whether "computer" is successfully installed-> "management"-> "service". you can see that the Nginx service has been installed successfully, for example:



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

The above describes how to install Nginx as a Windows service, including some content, and hope to be helpful to anyone interested in the PHP Tutorial.

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.