• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question [12.5.30] Vhosts logs location confusion

burnley

Regular Pleskian
First of all, sorry if this has been answered before, or it's documented in one of the Plesk manuals and I missed it, however I'm trying to understand how the virtual hosts logs location is set up in Plesk.
Just yesterday we've notices something NQR with several newly deployed vhosts. Say the domain name is dom1.com, Plesk appears to configure 2 logs locations:
1. /var/www/vhosts/dom1.com/logs
2. /var/www/vhosts/system/dom1.com/logs

For an older vhost both locations contain similar access_log & error_log files. In fact, stat shows the same inode is used for the files:
[root@host01 ~]# stat /var/www/vhosts/system/dom1.com/logs/access_log
File: ‘/var/www/vhosts/system/dom1.com/logs/access_log’
Size: 3545 Blocks: 8 IO Block: 1048576 regular file
Device: 27h/39d Inode: 4587694 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-01-17 09:32:36.997927209 +1100
Modify: 2017-06-15 14:41:08.559628129 +1000
Change: 2017-06-15 14:41:08.559628129 +1000
Birth: -
[root@host01 ~]# stat /var/www/vhosts/dom1.com/logs/access_log
File: ‘/var/www/vhosts/dom1.com/logs/access_log’
Size: 3545 Blocks: 8 IO Block: 1048576 regular file
Device: 27h/39d Inode: 4587694 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-01-17 09:32:36.997927209 +1100
Modify: 2017-06-15 14:41:08.559628129 +1000
Change: 2017-06-15 14:41:08.559628129 +1000
Birth: -
And for the directories:
[root@host01 ~]# stat /var/www/vhosts/dom1.com/logs
File: ‘/var/www/vhosts/dom1.com/logs’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 27h/39d Inode: 5899021 Links: 2
Access: (0700/drwx------) Uid: (10125/dom1com_ftp) Gid: ( 0/ root)
Access: 2017-01-17 09:13:36.685024680 +1100
Modify: 2017-06-15 00:09:15.993419145 +1000
Change: 2017-06-15 00:09:15.993419145 +1000
Birth: -
[root@host01 ~]# stat /var/www/vhosts/system/dom1.com/logs
File: ‘/var/www/vhosts/system/dom1.com/logs’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 27h/39d Inode: 4587654 Links: 2
Access: (0700/drwx------) Uid: ( 994/ psaadm) Gid: ( 0/ root)
Access: 2017-01-17 09:13:36.505021705 +1100
Modify: 2017-06-15 01:38:46.375932276 +1000
Change: 2017-06-15 01:38:46.375932276 +1000
Birth: -

Now, for a new vhost, called dom2.com, the one created yesterday, we still have the 2 directories:
[root@host01 ~]# stat /var/www/vhosts/dom2.com/logs
File: ‘/var/www/vhosts/dom2.com/logs’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 27h/39d Inode: 30544043 Links: 2
Access: (0700/drwx------) Uid: (10212/dom2com_ftp) Gid: ( 0/ root)
Access: 2017-06-14 11:26:57.018088110 +1000
Modify: 2017-06-14 11:26:57.018088110 +1000
Change: 2017-06-14 11:26:57.036088413 +1000
Birth: -
[root@host01 ~]# stat /var/www/vhosts/system/dom2.com/logs
File: ‘/var/www/vhosts/system/dom2.com/logs’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 27h/39d Inode: 8783497 Links: 2
Access: (0700/drwx------) Uid: ( 994/ psaadm) Gid: ( 0/ root)
Access: 2017-06-14 11:26:56.789084247 +1000
Modify: 2017-06-15 10:44:03.708530472 +1000
Change: 2017-06-15 10:44:03.708530472 +1000
Birth: -

The problem is, for dom2.com, /var/www/vhosts/dom2.com/logs is empty, no log files are created, however /var/www/vhosts/system/dom2.com/logs contains the log files I'm excepting there.

My first question: how are the 2 log locations implemented? One directory can't be hardlinked to the other, how can both directories contain the same access_log and error_log files?
The second question, which will probably be answered after knowing the answer to the first one :) How can I fix dom2.com logs so that the files appear in both /var/www/vhosts/dom2.com/logs and /var/www/vhosts/system/dom2.com/logs locations?
 
Maybe something was disturbing the vhost relink script. You can try
# /usr/local/psa/bin/repair --update-vhosts-structure
 
Back
Top