The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How does cPanel zip the access-logs symlink?

Discussion in 'General Discussion' started by Keeperax, Aug 5, 2016.

  1. Keeperax

    Keeperax Member

    Joined:
    Aug 5, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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 :)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. Keeperax

    Keeperax Member

    Joined:
    Aug 5, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  5. Keeperax

    Keeperax Member

    Joined:
    Aug 5, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bulgaria
    cPanel Access Level:
    Reseller Owner
    I was about to open a ticket in the beginning, however I am required to provide a support access ID which I do not have.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page