将下载的windows版nginx的压缩包nginx-1.4.2.zip解压到F:server ginx-1.4.2里面。
dos命令键入:
F:
cd F:server ginx-1.4.2
start nginx
发现启动界面一闪而过,经查看目录里面的日志文件F:server ginx-1.4.2logserror.log后发现,默认的80端口被占用。
2013/08/26 10:20:13 [emerg] 10632#10640: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
修改配置文件F:server ginx-1.4.2conf ginx.conf的Server配置里面的listen属性值,将80改为8011,保存。
listen 8011;
重新键入dos命令,查看Windows任务管理器,进程选项卡,出现nginx.exe,和访问localhost:8011后成功出现Welcome to nginx!页面则为启动成功。