nginxソース版を導入する際の注意事項
systemdの設定ファイルとlogrotateの設定が作成されないので作成する必要があります。
#Systemd設定ファイルの例(/usr/lib/systemd/system/nginx.service)
[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)"
[Install]
WantedBy=multi-user.target
#logrotateの設定ファイル例(/etc/logrotate.d/nginx)
/var/log/nginx/*log {
create 0640 nginx root
weekly
rotate 5
missingok
notifempty
compress
sharedscripts
postrotate
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
endscript
}
あと、nextcloudのcronが死んでた。原因はスクリプト実行の際に/var/lib/nginxにchdir使用としているがそんなディレクトリ無いということだったのでとりあえず当該ディレクトリを作成して復活させてます。
この現象、nextcloud初回起動時からずっとだったのでsiteguardの導入とは無関係そう。他の環境ではそもそも/var/lib/nginxなんか無くても普通に動くのだけど・・・何か変わったか?
ディスカッション
コメント一覧
まだ、コメントがありません