changing domain name, file ownership

when renaming example.com to example2.com, and looking in /var/log/virtualmin/ you will see the following:

-rw-r--r-- 1 root    root     0 Feb 19 10:23 example2.com_access_log
-rw-r--r-- 1 root    root     0 Feb 19 10:23 example2.com_error_log
-rw-rw---- 1 example nginx    0 Feb 19 10:18 example.com_access_log
-rw-rw---- 1 example nginx    0 Feb 19 10:18 example.com_error_log

problems: old log is kept. new log has wrong owner/group/permissions.

i don't think there are problems in other places. i did a "ls -alR /home/example/" and all files have the proper owner there. seems it's just this one per-site log file that's affected.

Status: 
Closed (fixed)

Comments

That seems like a bug. I assume you were using Nginx as your webserver in this case?

yes nginx enabled, apache disabled.

i suspect it may be because nginx runs as root, and the server rename process works by editing the nginx server config which tells it to output to a new log location, which doesn't exist yet, and thus it's created by nginx as root:root.

i guess rename could take care to pre-create a 0 byte log owned by the proper user/group combo before telling nginx to re-read its config.

Ok, I see the bug here - it will be fixed in the next Nginx plugin release.

Automatically closed -- issue fixed for 2 weeks with no activity.