Can't run installation wizard nor occ

I’ve installed nextcloud on fedora server, but don’t know how to proceed to get it to run. I added http service to the firewall, started httpd and created a symlink for nextcloud-access.conf.avail as instructed. That allows me to open a nextcloud page at server/nextcloud with this content:

Error

Configuration was not read or initialized correctly, not overwriting /usr/share/nextcloud/config/config.php

I understand that the installation wizard should be run on localhost, however, my server is headless. Can I allow remote access somehow? (I’m on a local network)

If this is not (easily) possible, I’ve heard about occ. That should be available at /var/www/html/nextcloud/occ, but in my case it isn’t. Where can I find occ on fedora?

occ would be in the Nextcloud files, and you run it directly via php.

You should be able to run the setup wizard from any browser that can reach the site, so I feel like you have some other problem. What do your permissions look like in /var/www/html?

2 Likes
/usr/share/nextcloud/config/config.php

It seems your Nextcloud installation path is /usr/share/ and not /var/www

in the /usr/share/Nextcloud there is a folder called occ:

/usr/share/nextcloud/occ

It is this path you needs to use instead. But it seems you ahs to go through your installation one more time, and ensure that your webserver and/or php-fpm is pointing at the right folder. If you have configured the document root to be: /var/www/
It will never load nextcloud, as that one is located in /usr/share (accroding to your error).

1 Like

These are the permissions for /var/www/html:

drwxr-xr-x. 2 root root 6 Mar  9 06:27 html

I want to repeat again what I did so far. Assume I have done nothing else.

dnf install nextcloud
firewall-cmd --add-service=http
systemctl start httpd
ln -s /etc/httpd/conf.d/nextcloud-access.conf.avail /etc/httpd/conf.d/z-nextcloud-access.conf
dnf install mariadb mariadb-server

apache (httpd) and php was installed as a dependency for nextcloud. I haven’t configured anything besides the symlink above.

If I have done anything wrong, it should be in the commands above.

What you mean by go through the installation one more time? Reinstalling the package?
I have not configured the webserver nor php-fpm to point anywhere (I don’t even know how to do that). Should I configure them to point somewhere? How?

Opening http://myserver gives me some basic fedora page, opening http://myserver/nextcloud gives me a page with the nextcloud logo and the error text in my first post. Since I actually can open something nextcloud-ish, I feel the webserver is actually pointing correctly.

Oh, I did find occ in /usr/share/nextcloud but haven’t tried to run it yet because it seems like I should be able to run the installation wizard and there seems to be something wrong.

can you show the output of

ls -la /usr/share/nextcloud

and

ls -la /usr/share/nextcloud/config/

all should be owned by the apache2 user

also after installing mysql and mysql-server you must finish setup mysql yourself

sudo mysql_secure_installation

see Installing MySQL/MariaDB :: Fedora Docs

ls -la /usr/share/nextcloud:

drwxr-xr-x.  13 root root 4096 Mar 31 13:13 .
drwxr-xr-x. 141 root root 4096 Apr  1 11:35 ..
drwxr-xr-x.  46 root root 4096 Mar 31 13:13 3rdparty
drwxr-xr-x.  50 root root 4096 Mar 31 13:13 apps
lrwxrwxrwx.   1 root root   14 Feb 21 11:37 config -> /etc/nextcloud
-rw-r--r--.   1 root root 4095 Jan 17 03:05 console.php
drwxr-xr-x.  23 root root 4096 Mar 31 13:13 core
-rw-r--r--.   1 root root 6317 Jan 17 03:05 cron.php
drwxr-xr-x.   2 root root 8192 Mar 31 13:13 dist
-rw-r--r--.   1 root root  156 Jan 17 03:05 index.html
-rw-r--r--.   1 root root 3456 Jan 17 03:05 index.php
drwxr-xr-x.   6 root root  125 Mar 31 13:13 lib
-rwxr-xr-x.   1 root root  279 Feb 21 11:37 occ
drwxr-xr-x.   2 root root   23 Mar 31 13:13 ocm-provider
drwxr-xr-x.   2 root root   55 Mar 31 13:13 ocs
drwxr-xr-x.   2 root root   23 Mar 31 13:13 ocs-provider
-rw-r--r--.   1 root root 3139 Jan 17 03:05 public.php
-rw-r--r--.   1 root root 5549 Jan 17 03:05 remote.php
drwxr-xr-x.   4 root root  133 Mar 31 13:13 resources
-rw-r--r--.   1 root root   26 Jan 17 03:05 robots.txt
-rw-r--r--.   1 root root 2452 Jan 17 03:05 status.php
drwxr-xr-x.   3 root root   35 Mar 31 13:13 themes
drwxr-xr-x.   2 root root   43 Mar 31 13:13 updater
-rw-r--r--.   1 root root  383 Jan 17 03:08 version.php

ls -la /etc/nextcloud/

drwxr-xr-x.   2 apache apache   45 Mar 31 13:13 .
drwxr-xr-x. 122 root   root   8192 Apr  1 11:35 ..
lrwxrwxrwx.   1 root   root     32 Feb 21 11:37 ca-bundle.crt -> /etc/pki/tls/certs/ca-bundle.crt
-rw-------.   1 apache apache  670 Feb 21 11:34 config.php

This came this way, I haven’t fiddled with it. Isn’t this something the package should take care of?

Yes, I did run sudo mysql_secure_installation, didn’t change anything.

Yes it should. However many factors on Linux can have an influence. Like in which context you did commands and such. Never the less, it seems that the entire Nextcloud library is owned by root. You will need to change the owner - recursively as well - to the webserver/PHP user.
Several things also looks like it is a bit more complex than I would anticipate. The config folder is a symling to another location. Most installs would have it in same path as rest.
All the Nextcloud server files (the application itself, which Apache and PHP needs to execute) is in your /usr/share/nextcloud path. So this is the documentroot of your nextcloud virtual host configuration for your apache config.

To fix the owner issue:

chown -r apache:apache /usr/share/nextcloud

Where is your data folder path?

I’ve changed the owner to apache as instructed, still no change though. The same error page as before.

I have not yet set a data folder path. Is there a default one I could check?

I think symlink won’t work outside the webroot due to security reasons.

you should move it to where it should be. this will also prevent troubles when nextcloud is trying to backup before a update.

remove the symbolic link

sudo rm /usr/share/nextcloud/config

create the config folder as user apache

sudo -u apache mkdir /usr/share/nextcloud/config

move the config.php file to it’s original location.

sudo -u apache mv /etc/nextcloud/config.php /usr/share/nextcloud/config/

I’ve removed the symlink and created the config directory with config.php inside it as instructed, but no change. It still doesn’t work.