Authored by Rock Zhang

优化nginx配置有关说明文件

framework @ 75bbc3b0
1 -Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05 1 +Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
1 -D:\nginx\instsrv.exe NGINX D:\nginx\srvany.exe  
2 -regedit /s D:\nginx\nginx.reg  
1 -Windows Registry Editor Version 5.00  
2 -  
3 -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NGINX\Parameters]  
4 -"Application"="D:\\workspace\\yohobuy.git.dev.yoho.cn\\script\\nginx\\nginx.exe"  
5 -"AppParameters"=""  
6 -"AppDirectory"="D:\\workspace\\"  
1 -English:  
2 -1.unzip to c:\nginx\  
3 -2.installservie.bat =>install nginx service  
4 -3.start-nginx.bat=>start nginx service  
5 - stop-nginx.bat=>stop nginx service  
6 -4.remove nginx service => WindowsServiceView.exe 1 +1. 在电脑上安装php,然后将php目录添加到PATH中。
  2 +2. 双击当前目录下的start-nginx-php.bat文件运行。
7 3
8 4
  5 +如果要停止服务,可以双击当前目录下的stop-nginx-php.bat文件。
9 6
10 -中文说明:  
11 -解压缩到c:\nginx\下  
12 -1.installservice.bat是安装nginx服务脚本,与些有关的文件是instsrv.exe, nginx.reg, srvany.exe  
13 -  
14 -2.启动, 停止, 重启脚本分别是start-nginx.bat, stop-nginx.bat, restart-nginx.bat, 与这有关的文件是process.exe  
15 -  
16 -3.删除nginx服务: 使用Windows服务查看工具删除,  
17 -再看一下注册表里HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NGINX\Parameters下的nginx项  
18 -  
19 -4.以这种服务方式运行nginx后,在0.7.52版本中(其它没试):平滑地让新配置文件生效的方式(即不用关掉nginx,再打开)  
20 -nginx -s reload, 似乎没作用了error.log里报OpenEvent("ngx_reload_5756") failed (2: 系统找不到指定的文件。)  
21 -那就只能重启了。  
22 -  
23 -其实有许多软件可以实现这种让程序以服务方式运行的功能, 但免费的我没有找到.  
24 -FireDaemon Pro  
25 -AlwaysUp  
26 -Application as Service  
  7 +注意:要把.\conf\vhosts目录下的yohobuy.conf第一个server中的root配置成对应项目目录
1 -@ECHO OFF  
2 -process -k nginx.exe  
3 -process -k nginx.exe  
4 -process -k nginx.exe  
5 -process -k nginx.exe  
6 -process -k nginx.exe  
7 -process -k nginx.exe  
8 -process -k nginx.exe  
9 -process -k nginx.exe  
10 -process -k nginx.exe  
11 -process -k nginx.exe  
12 -process -k nginx.exe  
13 -process -k nginx.exe  
14 -process -k nginx.exe  
15 -process -k nginx.exe  
16 -process -k nginx.exe  
17 -process -k nginx.exe  
18 -process -k nginx.exe  
19 -process -k nginx.exe  
20 -process -k nginx.exe  
21 -process -k nginx.exe  
22 -process -k nginx.exe  
23 -process -k nginx.exe  
24 -process -k nginx.exe  
25 -process -k nginx.exe  
26 -process -k nginx.exe  
27 -process -k nginx.exe  
28 -process -k nginx.exe  
29 -process -k nginx.exe  
30 -process -k nginx.exe  
31 -process -k nginx.exe  
32 -process -k nginx.exe  
33 -process -k nginx.exe  
34 -del logs\nginx.pid  
35 -  
36 -net stop nginx  
37 -net start nginx  
38 -EXIT  
  1 +@echo off
  2 +REM Windows 下无效
  3 +REM set PHP_FCGI_CHILDREN=5
  4 +
  5 +REM 每个进程处理的最大请求数,或设置为 Windows 环境变量
  6 +set PHP_FCGI_MAX_REQUESTS=1000
  7 +
  8 +echo Starting PHP FastCGI...
  9 +RunHiddenConsole php-cgi.exe -b 127.0.0.1:9000
  10 +
  11 +echo Starting nginx...
  12 +RunHiddenConsole nginx.exe
1 -@ECHO OFF  
2 -net stop nginx.exe  
3 -net start nginx.exe  
4 -E:  
5 -cd nginx  
6 -nginx.exe  
7 -  
8 -#@echo off  
9 -#echo Starting PHP FastCGI...  
10 -#RunHiddenConsole.exe D:\php\php-cgi.exe -b 127.0.0.1:9000 -c D:\php\php.ini  
11 -EXIT  
1 -@echo off  
2 -echo Starting PHP FastCGI...  
3 -RunHiddenConsole.exe D:\php\php-cgi.exe -b 127.0.0.1:9000 -c D:\php\php.ini  
1 -@echo off  
2 -echo Starting PHP FastCGI...  
3 -RunHiddenConsole.exe D:\php5.3.29\php-cgi.exe -b 127.0.0.1:9000 -c D:\php5.3.29\php.ini  
  1 +@echo off
  2 +echo Stopping nginx...
  3 +taskkill /F /IM nginx.exe > nul
  4 +echo Stopping PHP FastCGI...
  5 +taskkill /F /IM php-cgi.exe > nul
  6 +exit
1 -@ECHO OFF  
2 -process -k nginx.exe  
3 -process -k nginx.exe  
4 -process -k nginx.exe  
5 -process -k nginx.exe  
6 -process -k nginx.exe  
7 -process -k nginx.exe  
8 -process -k nginx.exe  
9 -process -k nginx.exe  
10 -process -k nginx.exe  
11 -process -k nginx.exe  
12 -process -k nginx.exe  
13 -process -k nginx.exe  
14 -process -k nginx.exe  
15 -process -k nginx.exe  
16 -process -k nginx.exe  
17 -process -k nginx.exe  
18 -process -k nginx.exe  
19 -process -k nginx.exe  
20 -process -k nginx.exe  
21 -process -k nginx.exe  
22 -process -k nginx.exe  
23 -process -k nginx.exe  
24 -process -k nginx.exe  
25 -process -k nginx.exe  
26 -process -k nginx.exe  
27 -process -k nginx.exe  
28 -process -k nginx.exe  
29 -process -k nginx.exe  
30 -process -k nginx.exe  
31 -process -k nginx.exe  
32 -process -k nginx.exe  
33 -process -k nginx.exe  
34 -process -k php-cgi.exe  
35 -process -k php-cgi.exe  
36 -process -k php-cgi.exe  
37 -process -k php-cgi.exe  
38 -del logs\nginx.pid  
39 -EXIT