I just wanted to install fail2ban also for phpmyadmin as described in another post. Then I found out that phpmyadmin doesn't log access on my apache. I installed phpmyadmin as follows:
apt-get install phpmyadmin
use with apache - added this line to /etc/apache2/apache2.conf:
Include /etc/phpmyadmin/apache.conf
In /etc/phpmyadmin/apache.conf I added
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{userID}n %{userStatus}n" pma_combined
CustomLog ${APACHE_LOG_DIR}/phpmyadmin_access.log pma_combined
ErrorLog ${APACHE_LOG_DIR}/phpmyadmin_error.log
tail -f /var/log/apache2/phpmyadmin_access.log
just contains:
127.0.0.1 - - [04/Sep/2015:14:11:37 +0200] "OPTIONS * HTTP/1.0" 200 110 "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
127.0.0.1 - - [04/Sep/2015:14:11:37 +0200] "OPTIONS * HTTP/1.0" 200 110 "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
but never logs access or even failed logins.
relevant parts of /etc/phpmyadmin/config.inc.php:
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
if (empty($dbserver)) $dbserver = 'localhost';
$cfg['Servers'][$i]['host'] = $dbserver;
if (!empty($dbport) || $dbserver != 'localhost') {
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['port'] = $dbport;
}
//$cfg['Servers'][$i]['compress'] = false;
I was not able to find any configuration in phpmyadmin to control logging. Logging in my virtual hosts configurations works just fine - I also just define CustomLog and ErrorLog there in the same manner.