在console下面启动nginx时,出现如下错误提示:
不管是nginx -s stop还是nginx -s reload
nginx: [error] OpenEvent("Global\ngx_reload_5744") failed (2: The system cannot find the file specified)
ps:在修改conf文件后并重新还原后,还是启动失败,这个如何让解决
这是因为你的nginx还没有启动,所以报错的。
启动nginx:
nginx
立即停止nginx:
nginx -s stop
平缓停止nginx(已有请求不会意外停止):
nginx -s quit
重新加载配置文件:
nginx -s reload
已经启动后,再修改conf文件。然后再reload就是不成功。kill掉80端口进程后还是不行
@Ronaldo7: 可以贴下你的配置文件看下吗?应该是.pid文件没有找到,加上-c参数指定配置文件试试。
@wenris:
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }
这是重装后的默认配置,
现在reload的话报的错就是:
nginx: [error] CreateFile() "F:\xxx\http_server\nginx-1.6.3/logs/nginx.pid" failed (2: The system cannot find the file specified)
我的目的是做一个nginx+java+windows的运行环境,nginx访问指定文件夹下面的静态文件。
@wenris: 已经解决了,是我没有使用命令: start nginx, 所以它没有初始化各种所需文件,所以就无法reload了,因为reload的基础是在service start后的,windows 还是没有linux好用,bug太多,感谢
http://www.cnblogs.com/lechie/archive/2011/11/12/2383258.html
这个没法解决, 重装吧, 并不是你改conf就能好的。
let me have look
请问这个问题怎么解决的,我也遇到这个问题了