How Can I See Apache Access Log in Near Realtime?

jazee

Well-Known Member
Jan 12, 2015
118
2
68
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?
 

jazee

Well-Known Member
Jan 12, 2015
118
2
68
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
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,251
313
Houston
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,