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!

How Can I See Apache Access Log in Near Realtime?

Discussion in 'General Discussion' started by jazee, Apr 4, 2018.

  1. jazee

    jazee Well-Known Member

    Joined:
    Jan 12, 2015
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I'm trying to troubleshoot a 502 error with a certain client. And one of the first things to do is to see if the https request is even making it to the server.

    What's strange is I can't find the Apache access log that should be updating. I have about a half dozen websites on the server so the access log should be moderately busy with varies web users access the site.

    I found /usr/local/cpanel/logs/access_log

    It is mostly filled with:
    ::1 - - [04/Apr/2018:13:33:27 -0700] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.33 (cPanel) OpenSSL/1.0.2o mod_bwlimited/1.4 (internal dummy connection)"

    If I scroll through it I find some user GET request for various sites but doesn't seem to be the volume I expected.

    So renamed the access_log to access_log.bak, effectively clearing it. I realized from past experience if memory serves me write Apache doesn't write to the log in real-time but periodically updates it. So I did some requests to a few different websites on the server and then went into WHM and restarted Apache hoping that would write our anything yet to be written to the log file. Strangely after a half hour now, there's no GET requests.

    I also found and did the same thing:

    /usr/local/cpanel/logs/access_log

    But all I see after clearing it is my own GET requests related to WHM (cpsess*)

    I then search the /home directory for access_log and only found the files for a couple of the over a dozen accounts.

    The log directory of the account in question only has compress archive files of past logs.

    Will the "real" Apache access log please stand up and show me the current requests to a specific if not all websites?

    Could I have possibly turned access_log usage off on these accounts somehow?
     
  2. jazee

    jazee Well-Known Member

    Joined:
    Jan 12, 2015
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I'm going to answer my own question for others who find themselves in this situation. Strangely, I could not easily find this info in a Google search and looks like Cpanel log documentation leaves this out!

    It's...... /usr/local/apache/domlogs
     
  3. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    1,445
    Likes Received:
    98
    Trophy Points:
    103
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @jazee

    I am happy to see you found the location of the domlogs. This is in our documentation as well. You can find all commonly used log locations here:

    The cPanel Log files - Apache


    Thank you,
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice