Score:0

apache2: how to log to mysql server

in flag

I have installed apache2 server and configured a site with the file site.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

This logs the accessed pages to the file access.log. Besides this logging, I would like to create another logging like the one in CustomLog.

However, I would like to log it to a mysql database. I know about piping in the CustomLog directive... Is this the way? How may I do this logging?

Note: I have Ubuntu Server 18.04 LTS, mysql Ver 14.14 Distrib 5.7.35 and Apache/2.4.29

Liso avatar
sd flag
THis guide shows how to exactly do that, no need over complicate things like piping. https://www.howtoforge.com/apache2-logging-to-a-mysql-database-with-mod_log_sql-on-debian-etch
JDias avatar
in flag
The `mod-log-sql` (version 100) has errors and its of very difficult configuration due to its errors. By the way, it is very old!!!!!!! Is there anything better? By the way, we are in 2021!!! Are `apache2` and/or `mysql` outdated? Till now I have not managed it to write to the database...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.