Nextcloud not working after installation

I got error 503 Service Not Available after nextcloud installation from Foris UI.
Here is part of the log where are visible some permission problems when I try to open nextcloud in the web browser. How I can fix this problem?

Apr 30 18:35:01 turris crond[13264]: (nobody) CMDOUT (PHP Warning:  fileperms(): stat failed for /srv/www/nextcloud/data/nextcloud.log in /srv/www/nextcloud/lib/private/Log/File.php on line 83)
Apr 30 18:35:01 turris crond[13264]: (nobody) CMDOUT ({"reqId":"BRHs2zkBtojpBvXMzwZ4","level":3,"time":"2021-04-30T18:35:01+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for /srv/www/nextcloud/data/nextcloud.log at /srv/www/nextcloud/lib/private/Log/File.php#83","userAgent":"--","version":""})
Apr 30 18:35:01 turris crond[13264]: (nobody) CMDOUT ({"reqId":"BRHs2zkBtojpBvXMzwZ4","level":3,"time":"2021-04-30T18:35:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/srv/www/nextcloud/lib/base.php","line":651,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"/srv/www/nextcloud/lib/base.php","line":1089,"function":"init","class":"OC","type":"::","args":[]},{"file":"/srv/www/nextcloud/cron.php","line":42,"args":["/srv/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/srv/www/nextcloud/lib/base.php","Line":282,"CustomMessage":"--"},"userAgent":"--","version":""})
Apr 30 18:35:01 turris crond[13264]: (nobody) CMDOUT (PHP Warning:  fileperms(): stat failed for /srv/www/nextcloud/data/nextcloud.log in /srv/www/nextcloud/lib/private/Log/File.php on line 83)
Apr 30 18:35:01 turris crond[13264]: (nobody) CMDOUT ({"reqId":"BRHs2zkBtojpBvXMzwZ4","level":3,"time":"2021-04-30T18:35:01+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for /srv/www/nextcloud/data/nextcloud.log at /srv/www/nextcloud/lib/private/Log/File.php#83","userAgent":"--","version":""})
Apr 30 18:35:01 turris crond[13264]: (nobody) CMDOUT ({"reqId":"BRHs2zkBtojpBvXMzwZ4","level":3,"time":"2021-04-30T18:35:01+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"chmod(): No such file or directory at /srv/www/nextcloud/lib/private/Log/File.php#84","userAgent":"--","version":""})

Hi @hyzami and thanks for reporting this issue.

Actually the culprit most likely is in the incorrect config.php in /srv/www/nextcloud/config/config.php.

Could you please check whether the config.php is empty or contains something?
In case it is empty, the fix is simple:

    1. remove /srv/www/nextcloud/config/config.php
    1. configure nextcloud in Foris->Storage page
      or
    1. run nextcloud_install in command line

For additional details, see this issue.