phpmyadmin / docker

Docker container for phpMyAdmin
https://hub.docker.com/_/phpmyadmin
GNU General Public License v3.0
665 stars 456 forks source link

Prevent apache access logs #343

Closed NiceJobMaster closed 3 years ago

NiceJobMaster commented 3 years ago

Hello. I would like to prevent apache access logs like the ones below on Windows 10. I run phpmyadmin in docker-compose with mysql.

phpmyadmin | 172.20.0.1 - - [11/Aug/2021:18:54:16 +0000] "GET / HTTP/1.1" 200 6345 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" phpmyadmin | 172.20.0.1 - - [11/Aug/2021:18:54:24 +0000] "POST /index.php?route=/ HTTP/1.1" 302 1158 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" phpmyadmin | 172.20.0.1 - - [11/Aug/2021:18:54:24 +0000] "GET /index.php?route=/&route=%2F HTTP/1.1" 200 18502 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" phpmyadmin | 172.20.0.1 - - [11/Aug/2021:18:54:25 +0000] "GET /themes/pmahomme/css/theme.css?v=5.1.1&nocache=4275738472ltr&server=1 HTTP/1.1" 200 37738 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36"

I know I can delete the file /var/log/apache2/access.log to prevent but I wish the new container did not have this file. How can I do this?

ibennetch commented 3 years ago

Probably the best solution is to remove the Transferlog line entirely, which I believe completely disables access logging.

I think you can redirect the output of the logging to null, by modifying the configuration file to Transferlog /dev/null.

You probably could instead ln -s /dev/null /var/log/apache2/access.log.

NiceJobMaster commented 3 years ago

How can i run that in my docker-compose file?

williamdes commented 3 years ago

How can i run that in my docker-compose file?

My first guess would be a Dockerfile but maybe try to create a volume like - /dev/null:/var/log/apache2/access.log

ibennetch commented 3 years ago

Probably the cleanest way is to create your own Dockerfile that you call from docker-compose instead of directly loading from phpMyAdmin.

NiceJobMaster commented 3 years ago

How can i run that in my docker-compose file?

My first guess would be a Dockerfile but maybe try to create a volume like - /dev/null:/var/log/apache2/access.log

It works, I wanted this solution. Thanks for the quick support!