Authored by Rock Zhang

优化nginx配置有关说明文件

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