首页 新闻 会员 周边

windows+java+nginx启动失败

0
悬赏园豆:50 [已解决问题] 解决于 2015-04-24 11:17

在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文件后并重新还原后,还是启动失败,这个如何让解决

Ronaldo7的主页 Ronaldo7 | 初学一级 | 园豆:159
提问于:2015-04-24 09:01
< >
分享
最佳答案
0

这是因为你的nginx还没有启动,所以报错的。

启动nginx:

nginx

立即停止nginx:

nginx -s stop

平缓停止nginx(已有请求不会意外停止):

nginx -s quit

重新加载配置文件:

nginx -s reload

收获园豆:35
wenris | 菜鸟二级 |园豆:244 | 2015-04-24 09:20

已经启动后,再修改conf文件。然后再reload就是不成功。kill掉80端口进程后还是不行

Ronaldo7 | 园豆:159 (初学一级) | 2015-04-24 10:29

@Ronaldo7: 可以贴下你的配置文件看下吗?应该是.pid文件没有找到,加上-c参数指定配置文件试试。

wenris | 园豆:244 (菜鸟二级) | 2015-04-24 10:33

@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访问指定文件夹下面的静态文件。

Ronaldo7 | 园豆:159 (初学一级) | 2015-04-24 10:44

@wenris: 已经解决了,是我没有使用命令: start nginx, 所以它没有初始化各种所需文件,所以就无法reload了,因为reload的基础是在service start后的,windows 还是没有linux好用,bug太多,感谢

Ronaldo7 | 园豆:159 (初学一级) | 2015-04-24 11:16
其他回答(2)
0

http://www.cnblogs.com/lechie/archive/2011/11/12/2383258.html

这个没法解决, 重装吧, 并不是你改conf就能好的。 

收获园豆:15
问天何必 | 园豆:3311 (老鸟四级) | 2015-04-24 09:08

let me have look

支持(0) 反对(0) Ronaldo7 | 园豆:159 (初学一级) | 2015-04-24 10:27
0

请问这个问题怎么解决的,我也遇到这个问题了

大漠飞鱼 | 园豆:73 (初学一级) | 2018-01-31 10:33
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册