VPS侦探论坛

标题: lnmp0.8升级nginx1.1.11后 启动的时候一个小问题 请教军哥 [打印本页]

作者: 毅丰    时间: 2011-12-25 14:28
标题: lnmp0.8升级nginx1.1.11后 启动的时候一个小问题 请教军哥
https://bbs.vpser.net/thread-6274-1-1.html 这个问题 我重装了一遍 解决了

然后我升级了 nginx 1.1.11 php5.3.8 都成功了 但是重启的时候

Restarting LNMP...
Starting Nginx...
Test Nginx configure...
Nginx program is reloding!
nginx: [warn] the "log_format" directive may be used only on "http" level in /usr/local/nginx/conf/nginx.conf:85
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
nginx: [warn] the "log_format" directive may be used only on "http" level in /usr/local/nginx/conf/nginx.conf:85
Shutting down MySQL. SUCCESS!
Starting MySQL. SUCCESS!
Gracefully shutting down php-fpm . done
Starting php-fpm  done

这么一段话

nginx nginx: [warn] the "log_format" directive may be used only on "http" level in /usr/local/nginx/conf/nginx.conf:85
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
nginx: [warn] the "log_format" directive may be used only on "http" level in /usr/local/nginx/conf/nginx.conf:85

不知道是不是哪里出错了 ?不过网站可以正常访问 85行 在 nginx.conf 是这么一段话

"$request" '
             '$status $body_bytes_sent "$http_referer" '
            
'"$http_user_agent" $http_x_forwarded_for';

请问军哥这是问题么?
作者: licess    时间: 2011-12-25 16:52
肯定自己修改配置文件,日志信息已经说了 log_format 只能放在http里
贴配置文件吧
作者: 毅丰    时间: 2011-12-25 21:42
标题: 回复 2# 的帖子
我装完直接就升级 1.1.11了 什么也没动,配置文件是指哪个?
作者: boonex    时间: 2011-12-26 13:59
我也遇到一样的问题,但是系统已经重装了,也没升级到那个版本。
作者: licess    时间: 2011-12-26 18:38
应该是你修改过配置文件

要不你自己贴配置文件
作者: 毅丰    时间: 2011-12-27 03:13
标题: 回复 5# 的帖子
user  www www;

worker_processes 1;

error_log  off;

pid        /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
        {
                use epoll;
                worker_connections 51200;
        }

http
        {
                fastcgi_intercept_errors on;
                include       mime.types;
                default_type  application/octet-stream;

                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 50m;

                sendfile on;
                tcp_nopush     on;

                keepalive_timeout 60;

                tcp_nodelay on;

                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 256k;

                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;

                #limit_zone  crawler  $binary_remote_addr  10m;

server
        {
                listen       80;
                server_name www.lnmp.org;
                index index.html index.htm index.php;
                root  /home/wwwroot;

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log  off;
        }
include vhost/*.conf;
}


这是配置 请看下
作者: licess    时间: 2011-12-27 09:41
标题: 回复 6# 的帖子
测试了一下没报错
作者: 毅丰    时间: 2011-12-27 10:38
原帖由 licess 于 2011-12-27 09:41 发表
测试了一下没报错
可是我的确实出现了。。
作者: licess    时间: 2011-12-27 11:35
标题: 回复 8# 的帖子
nginx 1.1.11 和1.0.10 都测试过了没问题
作者: 毅丰    时间: 2011-12-29 19:29
标题: 回复 9# 的帖子
唉 不纠结了 反正不影响使用
作者: leye55    时间: 2012-1-12 13:00
原帖由 licess 于 2011-12-27 09:41 发表
测试了一下没报错



我的是在升级1.1.12的之后出现的。
作者: leye55    时间: 2012-1-12 13:01
原帖由 licess 于 2011-12-27 11:35 发表
nginx 1.1.11 和1.0.10 都测试过了没问题


我是在升级成1.1.12的时候出现的

原帖由 licess 于 2011-12-27 09:41 发表
测试了一下没报错


这个问题我是出现在升级1.1.12的过程中  配置一样是没修改过的

user  www www;
worker_processes 1;
error_log  /home/wwwlogs/nginx_error.log  crit;
pid        /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
        {
                use epoll;
                worker_connections 51200;
        }
http
        {
                include       mime.types;
                default_type  application/octet-stream;
                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 50m;
                sendfile on;
                tcp_nopush     on;
                keepalive_timeout 60;
                tcp_nodelay on;
                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 256k;
                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;
                #limit_zone  crawler  $binary_remote_addr  10m;
server
        {
                listen       80;
                server_name cms.taidongyuan.cn;
                index index.html index.htm index.php;
                root  /home/wwwroot;
                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }
                location /status {
                        stub_status on;
                        access_log   off;
                }
                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }
                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }
                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log  /home/wwwlogs/access.log  access;
        }
include vhost/*.conf;
}
作者: ccloving    时间: 2012-1-15 15:16
我的也出现这个错误了。
作者: ccloving    时间: 2012-1-15 15:45
找到解决办法啦,将log那几行挪出server外就没事了:

                     }

             location ~ .*\.(js|css)?$
                     {
                             expires      12h;
                     }


     }
             log_format  phpfly.net  '$remote_addr - $remote_user [$time_loca
$request '
          '$status $body_bytes_sent $http_referer '
          '$http_user_agent $http_x_forwarded_for';
          '$http_user_agent $http_x_forwarded_for';
             access_log  /home/wwwlogs/phpfly.net.log  phpfly.net;
作者: hamen    时间: 2012-1-30 12:31
log_format  phpfly.net  '$remote_addr - $remote_user [$time_loca
$request '
          '$status $body_bytes_sent $http_referer '
          '$http_user_agent $http_x_forwarded_for';
          '$http_user_agent $http_x_forwarded_for';
             access_log  /home/wwwlogs/phpfly.net.log  phpfly.net; 把这些都删掉吗,这样acces_log还会有效吗?
作者: hamen    时间: 2012-1-30 20:38
升级到nginx1.1.13也出现这个问题
作者: hamen    时间: 2012-1-30 21:15
是我搞错了。.........




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4