windows平台上的nginx使用

转载自:[url]http://nginx.org/en/docs/windows.html[/url]

nginx/Windows uses the native Win32 API (not the Cygwin emulation level). Currently only the select method is used as a notification way, therefore you should not expect high performance and scalability. Because of this and some known issues nginx/Windows is considered as a beta version. There is almost full-functionality in nginx/Windows as in Unix version, except XSLT filter, image filter, GeoIP module, and embedded Perl language.

To install nginx/Windows, you should download the latest 0.8.32 development version zipped file, since the development branch contains all known fixes, especially Windows related. Then you should unzip the file, go to the nginx-0.8.32 directory, and run nginx. Here is an example for the drive C: root directory:

cd c:\
unzip nginx-0.8.32.zip
cd nginx-0.8.32
start nginx

You may run the “tasklist” command line utility to see nginx processes:

C:\nginx-0.8.32>tasklist /fi "imagename eq nginx.exe"

Image Name PID Session Name Session# Mem Usage
=============== ======== ============== ========== ============
nginx.exe 652 Console 0 2 780 K
nginx.exe 1332 Console 0 3 112 K

One of the processes is the master process and another is the worker process. If nginx have not started, you should look in the “logs\error.log” file for the reason. If the log file has not been created, the reason should be reported in Windows Event Log. If you see an error page instead of the expected page, you should also look in the “logs\error.log” file for the error reason.

nginx/Windows uses the directory where it has been run as the prefix directory for relative paths in the configuration. In the example above, the prefix directory is “C:\nginx-0.8.32\”. Paths in the configuration must be set in Unix style using slashes:

access_log logs/site.log;
root C:/web/html;

nginx/Windows runs as an usual application, not a service, and it can be managed using the following commands:

nginx -s stop quick exit
nginx -s quit graceful quit
nginx -s reload changing configuration, starting a new worker, quitting gracefully an old worker
nginx -s reopen reopening log files

Known issues

* Although several workers can be run, only one of them works actually.
* A worker can handle no more than 1024 simultaneous connections.
* The cache and other modules requires a shared memory support do not work in Windows Vista and later due to address space layout randomization enabled in these Windows versions.

Possible future enhancements

* Running as a service.
* Using the I/O completion ports as notification method.
* Using the worker threads inside single worker.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值