How does cPanel zip the access-logs symlink?

Keeperax

Member
Aug 5, 2016
8
1
3
Bulgaria
cPanel Access Level
Reseller Owner
I am trying to access the current (active) raw access logs in cPanel through SSH. For that, I found out that the access-logs symlink:
Code:
lrwxrwxrwx  1 user user 34 Aug  6 03:00 access-logs -> /usr/local/apache/domlogs/user
needs to be zipped. Zip is installed on the server but I am unable to zip the access-logs symlink. I have so far tried:
Code:
zip -r /home/homeqpig/access-logs-ftw.zip access-logs
which returns:
Code:
zip warning: name not matched: access-logs
I have also tried using the --symlink option of zip but to no avail.

Now I did run a "top -c" whilst having cPanel's file manager zip the access-logs symlink and I saw that it runs the same:
Code:
43097 user 39  19 99.1m 1228  800 R  7.1  0.0   0:00.07 zip -r /home/user/access-logs.zip access-logs
What could be the problem zipping the access-logs via SSH? Is it possible? Am I doing something wrong?

Thank you :)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
Hello,

Are you logged in via SSH as "root" or as the account username? Also, ensure you use the full path to "access-logs" in-case you aren't in the correct directory. EX:

Code:
zip /home/$username/access-logs-test.zip /home/$username/access-logs
Thank you.
 

Keeperax

Member
Aug 5, 2016
8
1
3
Bulgaria
cPanel Access Level
Reseller Owner
I do not have root privileges - just a jailshell for the account username. It appears, though, that the symlink is in a chroot jail.

And yes, I have tried full paths all the way long as well as using 7zip, tar and others.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
Hi @Keeperax,

I've found this is actually related to an internal case, EA-4835, where /etc/apache2 isn't mounted for jailshell users. This leads to the issue you described where zipping the access-log file under /home/$user/ fails because it's not accessible. I'll update this thread once the resolution is published. In the meantime, you can add the following custom mount point in /var/cpanel/jailshell-additional-mounts using the instructions at How to Create Custom Jailed Shell (Jailshell) Mounts - cPanel Knowledge Base - cPanel Documentation :

Code:
/etc/apache2/logs/domlogs
Ensure you remove this entry after the resolution is published.

Thank you.