Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrade to 13.0.1 getting permission denied using logging app #9051

Closed
whositwhatnow opened this issue Apr 2, 2018 · 2 comments
Closed

Comments

@whositwhatnow
Copy link

When using the logging app in the admin panel, I get a spinning circle and when I look at my apache logs it gives the following error:

[Mon Apr 02 08:45:37 2018] [error] [client ] {"reqId":"Kj0LxKBlNBkMvCtHhAtB","level":3,"time":"2018-04-02T07:45:37-05:00","remoteAddr":"x.x.x.x","user":"admin","app":"PHP","method":"GET","url":
"\/nextcloud\/index.php\/apps\/logreader\/get?offset=0&count=50","message":"fopen(\/var\/log\/nextcloud.log): failed to open stream: Permission denied at \/var\/www\/html\/nextcloud\/apps\/logreade
r\/lib\/Controller\/LogController.php#56","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/64.0.3282.186 Safari\/537.36","version":"13.0.1.1"}

the permissions on that file is:

-rw-r--r-- 1 apache apache 6005 Mar 28 21:06 LogController.php

im assuming it needs the execute permission as well, but am not 100% sure.

I did the upgrade via teh command line using occ.

@MorrisJobke
Copy link
Member

The parent folders need the executable bit set as well for the apache user. Most likely you need to set it for the world permissions for /var and /var/log.

@francescor
Copy link

francescor commented Nov 2, 2019

world permissions for /var and /var/log ? mmh...

I solved it by moving the log file to a dedicated directory

sudo mkdir /var/log/nextcloud
sudo chown www-data.root /var/log/nextcloud
sudo cp /var/log/nextcloud/nextcloud.log /var/log/nextcloud
sudo chown www-data.root /var/log/nextcloud/nextcloud.log

then update settings (or just adding the new line) in /var/www/nextcloud/config/config.php to get:

<   'logfile' => '/var/log/nextcloud/nextcloud.log',
---
>   'logfile' => '/var/log/nextcloud.log',

then reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants