13

I followed the guide on https://blog.ssdnodes.com/blog/installing-nextcloud-docker/ and got the docker containers running. I changed the port mappings of nextcloud-proxy to 7443:443, 780:80, since my server already has an apache running.

When I open the page foo.bar.com:7443, it shows me a server error 500 page by nginx.

docker logs --details nextcloud-proxy only shows me, that the error-500-page was successfully delivered.

docker logs --details nextcloud-app does not show any errors regarding the request. It only shows some messages during startup:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.5. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.5. Set the 'ServerName' directive globally to suppress this message
[Mon Mar 04 19:23:01.413561 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.15 configured -- resuming normal operations
[Mon Mar 04 19:23:01.413653 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

It is pretty clear, that there is an error with apache or php (both should be logged by nextcloud-app). But I need to see the error log entries. How do I do this?

Leif
  • 2,143
  • 2
  • 15
  • 26

3 Answers3

7

Logs are redirected to nextcloud's data folder.

From your nextcloud's root, try with:

$ tail nextcloud/data/nextcloud.log

(or the folder you set for data storage).

Marc Bria
  • 71
  • 1
  • 4
1

In my case, it helped to configure Nextcloud to use stdout instead of a dedicated logfile for its logging output.
This allows you to see all the logs instead of just the php fpm output in the if you execute docker logs <yourcontainerid> or view it in Portainer or some other management software.

Just add the following to your config.php

 "logfile" => "/dev/stdout",
Mayor Mayer
  • 150
  • 2
  • 12
0

It's even better if you run the nextcloud with this switch to mount it to a folder on your host, edit config/config.php to have finer-grained logs through setting loglevel, the run tail -f data/nextcloud.logs

docker run -v ~/Projects/nextcloud:/var/www/html -d -p 8080:80 nextcloud
<?php
$CONFIG = array (
    'htaccess.RewriteBase' => '/',
...
...
...
    'loglevel' => 0,
);

Restart the docker image by running docker restart YOUR_INSTNANCE_ID

Then docker exec -it YOUR_INSTNANCE_ID bash -c "tail -f /var/www/html/data/nextcloud.log"

Jahan Zinedine
  • 14,616
  • 5
  • 46
  • 70