Why are Apache logs stored twice in domlogs?
Folks,
Why are Apache logs stored twice in directory /var/log/apache2/domlogs?
For example, my domain has:
-rw-r----- 2 root uuism 792056 Nov 5 23:28 /var/log/apache2/domlogs/uuism.net-ssl_log
-rw-r---- 2 root uuism 792056 Nov 5 23:28 /var/log/apache2/domlogs/uuism/uuism.net-ssl_log
the files are identical
diff /var/log/apache2/domlogs/uuism.net-ssl_log /var/log/apache2/domlogs/uuism/uuism.net-ssl_log
<no output>
Same two files for http logs named uuism.net:
# ls -la uuism*
-rw-r----- 2 root uuism 142415 Nov 5 23:30 uuism.net
-rw-r----- 2 root uuism 796828 Nov 5 23:36 uuism.net-ssl_log
# ls -la ../uuism.net*
-rw-r----- 2 root uuism 142415 Nov 5 23:30 ../uuism.net
-rw-r----- 1 root root 1078 Nov 5 23:30 ../uuism.net-bytes_log
-rw-r----- 2 root uuism 796828 Nov 5 23:36 ../uuism.net-ssl_log
Thanks,
Jim
-
Hey there! They actually aren't stored twice on the system, but the user directories are created for statistical purposes. If you examine the files themselves, you'll see they are a hard link because they are the same file using the same inode. Here is an example from my personal machine showing this, and you'll see the exact same inode number in use on both:
[root@host domlogs]# stat domain.com
File: domain.com
Size: 663 Blocks: 8 IO Block: 4096 regular file
Device: 800h/2048d Inode: 273781 Links: 2
Access: (0640/-rw-r-----) Uid: ( 0/ root) Gid: ( 1003/ username)
Access: 2024-11-06 07:10:34.922789080 -0500
Modify: 2024-11-06 10:59:36.576144364 -0500
Change: 2024-11-06 10:59:36.576144364 -0500
Birth: 2024-11-06 07:10:34.922789080 -0500[root@host domlogs]# stat username/domain.com
File: folder/domain.com
Size: 663 Blocks: 8 IO Block: 4096 regular file
Device: 800h/2048d Inode: 273781 Links: 2
Access: (0640/-rw-r-----) Uid: ( 0/ root) Gid: ( 1003/ username)
Access: 2024-11-06 07:10:34.922789080 -0500
Modify: 2024-11-06 10:59:36.576144364 -0500
Change: 2024-11-06 10:59:36.576144364 -0500
Birth: 2024-11-06 07:10:34.922789080 -05000
Please sign in to leave a comment.
Comments
1 comment