Re: nginx не создаёт файлы логов

Грек Финский rpekfi на gmail.com
Вс Янв 15 10:49:51 UTC 2012


Спасибо за отклик.

Конфиги:
vi /usr/local/etc/nginx/nginx.conf
user  nobody;
worker_processes  4;

error_log  /var/log/www/nginx_error.log info;
#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"';

    sendfile        on;

    keepalive_timeout  615;
    send_timeout 3000;

server{
       listen  80;
       server_name  localhost.lan;
       error_log   /usr/www/localhost.lan/logs/error.log warn;
       access_log  /usr/www/localhost.lan/logs/access.log main;

        location / {
               root /usr/www/localhost.lan/htdocs/;
               index index.html index.htm default.php index.php;
        }

        location ~*\.(ico|png|jpg|jpeg|gif|css|js|txt)$ {
                root         /usr/www/localhost.lan/htdocs/;
                access_log   off;
                expires      30d;
        }

        location ~\.php$ {
                fastcgi_pass   unix:/tmp/www_local_php-fpm.sock;
                fastcgi_index  default.php;
                fastcgi_param  SCRIPT_FILENAME
 /usr/www/localhost.lan/htdocs/$fastcgi_script_name;
                include        fastcgi_params;
        }
}


-------------------------------

# vi /usr/local/etc/php-fpm.conf

-------------------------------

[www_local]
listen = /tmp/www_local_php-fpm.sock
user =www_local
group =www_local
pm = dynamic
pm.max_children = 4
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 2
pm.max_requests = 500
slowlog = /var/log/php-fpm_slow_www_local.log
php_admin_value[open_basedir]="/usr/www/localhost.lan/"
php_admin_value[upload_tmp_dir]="/usr/www/localhost.lan/upload/"
php_admin_value[session.save_path]="/usr/www/localhost.lan/session/"

-------------------------------

# /usr/local/etc/rc.d/nginx restart
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 18830.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.

-------------------------------

/usr/www/localhost.lan/logs#ls -all
total 8
drwxr-xr-x   2 www_local  www_local  512 Jan 14 15:16 .
drwxr-xr-x  13 www_local  www_local  512 Jan 14 15:16 ..

-------------------------------

/var/log# ls -all
....
-rw-r--r--   1 root    wheel         0 Jan 15 14:46 nginx-error.log
....


15 января 2012 г. 15:13 пользователь Andrey N. Oktyabrski
<ano на bestmx.ru>написал:

> On 15.01.12 12:27, Михаил Монашёв wrote:
>
>> nginx не создаёт файлы логов и соотвественно ничего туда не
>>> пишет.
>>>
>>
>> Скорее всего у nginx-а нет прав для создания файла с логами.
>>
> А разве он запустится при этом? По-моему, он матерится и дохнет.
>
>
> ______________________________**_________________
> nginx-ru mailing list
> nginx-ru на nginx.org
> http://mailman.nginx.org/**mailman/listinfo/nginx-ru<http://mailman.nginx.org/mailman/listinfo/nginx-ru>
>
----------- следущая часть -----------
Вложение в формате HTML было извлечено…
URL: <http://mailman.nginx.org/pipermail/nginx-ru/attachments/20120115/f33dcaa3/attachment-0001.html>


Подробная информация о списке рассылки nginx-ru