From 61a5243ee4827872622f09ca5271c890529aaeba Mon Sep 17 00:00:00 2001 From: Shiham Abdul Rahman Date: Fri, 7 Oct 2022 19:49:52 +0500 Subject: [PATCH] enabled logs --- Dockerfile | 2 +- buildfiles/auto_config.sh | 4 ++++ buildfiles/etc/nginx/sites-available/nextcloud_nginx.conf | 4 ++++ buildfiles/etc/php/8.1/fpm/php-fpm.conf | 2 +- docker-compose.yml | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 47d4fbd..d38c5a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,7 +67,7 @@ RUN bash -c 'apt install -y php${PHPVERSION}-imagick imagemagick ffmpeg libreoff # Delete default stuff #nginx RUN rm -rv /var/www/html/index.nginx-debian.html \ - /etc/php/ + /etc/php/ \ /etc/nginx/ #Autoconfig defaults diff --git a/buildfiles/auto_config.sh b/buildfiles/auto_config.sh index 03817b2..422c0bf 100644 --- a/buildfiles/auto_config.sh +++ b/buildfiles/auto_config.sh @@ -8,6 +8,10 @@ ln -sv /etc/nginx/sites-available/nextcloud_nginx.conf /etc/nginx/sites-enabled/ cp -rv default_configs/etc/php /etc/ touch init/init +#Create log dirs +mkdir -pv /root/logs/nginx +mkdir -pv /root/logs/php-fpm + echo defaults configs are deployed, please check and change any required configs and restart container pkill bash diff --git a/buildfiles/etc/nginx/sites-available/nextcloud_nginx.conf b/buildfiles/etc/nginx/sites-available/nextcloud_nginx.conf index 926d21b..45d9ff1 100644 --- a/buildfiles/etc/nginx/sites-available/nextcloud_nginx.conf +++ b/buildfiles/etc/nginx/sites-available/nextcloud_nginx.conf @@ -9,6 +9,10 @@ server { listen 80; server_name _; + #Logs + access_log /root/logs/nginx/access.log; + error_log /root/logs/nginx/error.log; + # Path to the root of your installation root /var/www/nextcloud; diff --git a/buildfiles/etc/php/8.1/fpm/php-fpm.conf b/buildfiles/etc/php/8.1/fpm/php-fpm.conf index 771bcb4..f8e5795 100644 --- a/buildfiles/etc/php/8.1/fpm/php-fpm.conf +++ b/buildfiles/etc/php/8.1/fpm/php-fpm.conf @@ -23,7 +23,7 @@ pid = /run/php/php8.1-fpm.pid ; into a local file. ; Note: the default prefix is /var ; Default Value: log/php-fpm.log -error_log = /var/log/php8.1-fpm.log +error_log = /root/logs/php-fpm/php8.1-fpm.log ; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities diff --git a/docker-compose.yml b/docker-compose.yml index 10671aa..58ceb5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: image: git.shihaam.me/dockerfiles/nextcloud volumes: - ./configs/init:/root/init -# - ./logs:/logs + - ./logs:/root/logs - ./configs/etc/nginx:/etc/nginx - ./configs/etc/php:/etc/php ports: