VPS侦探论坛

 找回密码
 注册
查看: 15537|回复: 16

lnmp0.8升级nginx1.1.11后 启动的时候一个小问题 请教军哥

[复制链接]
发表于 2011-12-25 14:28:10 | 显示全部楼层 |阅读模式

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';

请问军哥这是问题么?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-12-25 16:52:08 | 显示全部楼层


肯定自己修改配置文件,日志信息已经说了 log_format 只能放在http里
贴配置文件吧
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-12-25 21:42:35 | 显示全部楼层

回复 2# 的帖子


我装完直接就升级 1.1.11了 什么也没动,配置文件是指哪个?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-12-26 13:59:11 | 显示全部楼层



我也遇到一样的问题,但是系统已经重装了,也没升级到那个版本。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-12-26 18:38:42 | 显示全部楼层

应该是你修改过配置文件

要不你自己贴配置文件

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-12-27 03:13:37 | 显示全部楼层

回复 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;
}


这是配置 请看下
发表于 2011-12-27 09:41:14 | 显示全部楼层

回复 6# 的帖子


测试了一下没报错
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-12-27 10:38:58 | 显示全部楼层

原帖由 licess 于 2011-12-27 09:41 发表
测试了一下没报错
可是我的确实出现了。。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-12-27 11:35:59 | 显示全部楼层

回复 8# 的帖子


nginx 1.1.11 和1.0.10 都测试过了没问题

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-12-29 19:29:59 | 显示全部楼层

回复 9# 的帖子




唉 不纠结了 反正不影响使用
发表于 2012-1-12 13:00:17 | 显示全部楼层

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



我的是在升级1.1.12的之后出现的。
发表于 2012-1-12 13:01:44 | 显示全部楼层

原帖由 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;
}
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-1-15 15:16:55 | 显示全部楼层
我的也出现这个错误了。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-1-15 15:45:17 | 显示全部楼层
找到解决办法啦,将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;

军哥运维代购:http://shop63846532.taobao.com/

发表于 2012-1-30 12:31:33 | 显示全部楼层
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还会有效吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-22 05:42 , Processed in 0.030638 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表