: 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:
-
- Nginx
- Nginx
- Nginx
- D: \ www \ nginx \ nginx.exe
- D: \ www \ logs \
- Roll
-
- -P d: \ www \ nginx
- -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:
-
- Nginx
- Nginx
- Nginx
- D: \ BALANCE_TOMCAT__NGINX \ nginx-1.6.0 \ nginx.exe
- D: \ BALANCE_TOMCAT__NGINX \ nginx-1.6.0 \ logs \
- Roll
-
- -P D: \ BALANCE_TOMCAT__NGINX \ nginx-1.6.0
- -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:
- NG_SRV
-
- Installation for nginx server like a service.
-
- 1. Change in ng_srv.xml path for your nginx path.
- 2. Launch "ng_srvinst.bat install" for service installation.
-
- 3. For uninstall launch "ng_srvinst.bat remove ".
-
- 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.