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:
- < Service >
- < ID > Nginx ID >
- < name > Nginx name >
- < Description > Nginx Description >
- < executable > D:\www\nginx\nginx.exe executable >
- < LogPath > D:\www\logs\ logpath >
- < LogMode > Roll logmode >
- < depend > depend >
- < startargument > - P D:\www\nginx startargument >
- < stopargument > - p d:\www\nginx-s Stop stopargument >
- 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:
- < Service >
- < ID > Nginx ID >
- < name > Nginx name >
- < Description > Nginx Description >
- < executable > D:\BALANCE_TOMCAT__NGINX\nginx-1.6.0\nginx.exe executable >
- < LogPath > D:\BALANCE_TOMCAT__NGINX\nginx-1.6.0\logs\ logpath >
- < LogMode > Roll logmode >
- < depend > depend >
- < startargument > - P D:\BALANCE_TOMCAT__NGINX\nginx-1.6.0 startargument >
- < stopargument > - p D:\BALANCE_TOMCAT__NGINX\nginx-1.6.0-s Stop stopargument >
- 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:
- ng_srv
-
- installation for Nginx server like a serv Ice.
-
- 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
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.