Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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 get user's FTP log?

Discussion in 'General Discussion' started by Keeperax, Nov 7, 2016.

Tags:
  1. Keeperax

    Keeperax Member

    Joined:
    Aug 5, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bulgaria
    cPanel Access Level:
    Reseller Owner
    Greetings,

    I am quite puzzled as to how cPanel extracts the FTP logs for a certain domain name in a hosting account. In the "Raw Access" menu the user can download the access logs for his domain(s) but he can also download the FTP log for the specific domain name.

    How does that work?

    I can see that the URL address follows this structure:
    Code:
    https://[host]/[SESSION_ID]/getftpaccesslog/ftpaccesslog_ftp.example.com_11_7_2016.gz
    I checked the server's /usr/local/cpanel/base directory and I cannot find a file or directory called getftpaccesslog. it also appears that this is not one of cPanel's scripts that are located in
    /usr/local/cpanel/scripts as I cannot find it there as well.

    Additionally, it does not seem to be generating it on the fly since I have used FTP only for one of my domain names (user@example.com) and it knows which domain has FTP logs because it shows a link titled domain2083/cpsess2314468124/getftpaccesslog/ftpaccesslog_ftp.example.com_11_7_2016.gz.

    Could someone please clarify how this works? Are the FTP logs stored somewhere on the server? The FTP logs are not to be found in /etc/httpd/domlogs/ where the access log reside.
     
    #1 Keeperax, Nov 7, 2016
    Last edited by a moderator: Nov 7, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Check to see if the following option is enabled on this system under the "Stats and Logs" tab in "WHM >> Tweak Settings":

    Keep master FTP log file

    Here's a description of this option:

    Keep Apache’s domlogs/ftpxferlog after it has been separated into each domain name’s FTP log.

    The Apache domlogs directory in EasyApache 4 is located at:

    /var/log/apache2/domlogs/

    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
    Hi,

    The option you mentioned is checked (enabled).
     
  4. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    335
    Likes Received:
    95
    Trophy Points:
    28
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
  5. Keeperax

    Keeperax Member

    Joined:
    Aug 5, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bulgaria
    cPanel Access Level:
    Reseller Owner
    Thank you. I did find my FTP log in
    /usr/local/apache/domlogs/ftp.example.com-ftp_log but I would also like to know how cPanel reads and parses it. The file name in the link that cPanel gives is: ftpaccesslog_ftp.example.com_11_7_2016.gz
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    cPanel automatically writes the file into an archived format for download. It's handled through cpsrvd and isn't something you can do manually. Here's the entry in /usr/local/cpanel/logs/access_log when this happens:

    Code:
    1.2.3.4 - test01 [11/09/2016:20:34:38 -0000] "GET /cpsess12345678/getftpaccesslog/ftpaccesslog_ftp.test01.com_11_9_2016.gz HTTP/1.1" 200 0 "https://1.2.3.4:2083/cpsess12345678/frontend/paper_lantern/raw/index.html"
    
    Thank you.
     
  7. Keeperax

    Keeperax Member

    Joined:
    Aug 5, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bulgaria
    cPanel Access Level:
    Reseller Owner
    Thank you for the reply - got all the information I needed.

    You can consider this topic as finished.
     
    cPanelMichael likes this.
  8. Keeperax

    Keeperax Member

    Joined:
    Aug 5, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bulgaria
    cPanel Access Level:
    Reseller Owner
    Also, one more question. How often does cPanel update the FTP log files?
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Logs are processed every 24 hours by default, but you can change this setting via:

    "WHM Home » Server Configuration » Statistics Software Configuration"

    Thank you.
     
Loading...

Share This Page