• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Apache, httpd.conf, trying to log cookies

B

bona fide

Guest
I'm trying to get cookies in the Apache log files, but it isn't working.

/etc/httpd/conf/httpd.conf contains:
LoadModule usertrack_module modules/mod_usertrack.so
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined
CustomLog logs/access_log combined

.htaccess contains:
CookieTracking On
CookieExpires "5 years"
CookieName "mycookie"

and I've restarted Apache via:
/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/httpd start

but nada in access_log. I've tried modifying vhost.conf too.

Am I missing a typo, or what?

Thanks!
 
Finally figured this out. The cookies were getting written to the client, and were getting passed. The issue had to do with the Apache configuration. Coding the following specific fpointer to the log file in vhost.conf fixed it:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined
CustomLog /home/httpd/vhosts/mydomain.com/statistics/logs/access_log combined

Dear SWsoft: Please please please document the relationship between httpd.conf, httpd.include, and vhost.conf, and how to manage the location and contents of the log files. This took hours upon hours of experimentation and research.
 
Back
Top