Skip to content

Instantly share code, notes, and snippets.

@KitaitiMakoto
Last active September 3, 2015 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KitaitiMakoto/f314ad891728f71d322c to your computer and use it in GitHub Desktop.
Save KitaitiMakoto/f314ad891728f71d322c to your computer and use it in GitHub Desktop.
MT for AWS Nginx HVMのログディレクトリーのパーミッション
作成したばかりのインスタンスにて。
Nginx worker(nobody)から再オープンできないように見える。
と言うか実際、sudo service nginx reopen_logsやったら(/etc/logrotate.d/nginxがやってる)、
access.logが空になった後ログが書き込まれない。
/data/conf/nginx.confではuser nobody;となっているけど、Amazon LinuxのリポジトリーかられたばかりのNginxバッケージではこの行はコメントアウトされている。
コメントインしたけどログディレクトリーやファイルのパーミッション調整がされていなかったということなのだろうか。
$ ll /var/log/
合計 196
drwxr-x--- 2 root root 4096 6月 26 02:39 audit
-rw------- 1 root root 0 9月 3 15:09 boot.log
-rw------- 1 root utmp 0 6月 26 02:49 btmp
-rw-r--r-- 1 root root 7800 9月 3 15:10 cloud-init-output.log
-rw-r--r-- 1 root root 72591 9月 3 15:10 cloud-init.log
-rw------- 1 root root 359 9月 3 15:10 cron
-rw-r--r-- 1 root root 23534 9月 3 15:09 dmesg
-rw-r--r-- 1 root root 0 6月 26 02:49 dmesg.old
-rw-r--r-- 1 root root 204692 9月 3 15:12 lastlog
drwxr-xr-x 2 root root 4096 3月 18 15:30 mail
-rw------- 1 root root 792 9月 3 15:10 maillog
-rw------- 1 root root 34026 9月 3 15:10 messages
-rw-r----- 1 mysql mysql 2013 9月 3 15:10 mysqld.log
drwx------ 2 nginx nginx 4096 9月 3 15:10 nginx
drwxr-xr-x 2 ntp ntp 4096 5月 4 21:10 ntpstats
drwxrwx--- 2 root root 4096 9月 3 15:10 php-fpm
-rw------- 1 root root 1148 9月 3 15:12 secure
-rw------- 1 root root 0 3月 18 15:30 spooler
-rw------- 1 root root 0 3月 18 15:29 tallylog
-rw-rw-r-- 1 root utmp 8064 9月 3 15:12 wtmp
-rw------- 1 root root 404 9月 3 15:10 yum.log
$ sudo ls -l /var/log/nginx/
合計 0
-rw-r--r-- 1 root root 0 9月 3 15:10 access.log
-rw-r--r-- 1 root root 0 9月 3 15:10 error.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment