Nextcloud with Leap 16.0

Hi all, does anyone have experience with installing and running Nextcloud on Leap 16.0?
I did a fresh & new Leap 16 installation (no VM, updated) and then

  • installation of apache2, mysql, mariadb and nextcloud with myrlyn.
  • sudo systemctl start apache2, mysql, mariadb
  • then firefox go http://localhost/nextcloud

and get always the same error “can’t write into config directory! This can usually be fixed by giving the webserver write access to the config directory.”.

I noticed that the nextcloud installation does NOT create a config.php file in /srv/www/htdocs/nextcloud/config (the example config.example.php is there), which I think should have been created during the installation process. After I created a fake config.php the error was different, so it’s not a write access problem…

Any ideas?

@flint Hi, Could be a SELinux and Apache issue…

At the side menu there is a link to the SELinux Portal and some checks you can run. I suspect the best thing to do if it is SELinux is create a bug report.

Way not install the package from repo?
In some days version 33 will be online.

Thanks @malcolmlewis for the genius hint !
I haven’t thought about SELinux. I assumed that when I install from the official Leap repo, then this should not be an issue…

So, I tested:

  1. disable SELinux temporarily
    1.1 to disable SELinux on a Linux system, $ sudo setenforce 0
    1.2 confirm the change by running getenforce, which should return “permissive”
    1.3 do NOT restart (a restart would enable SELinux again)
  2. I wanted to be sure, so I de-installed Nextcloud (because I don’t know what the installation process is really doing)
  3. sudo systemctl start apache2, mysql, mariadb
  4. install Nextcloud again/new from Leap repo
  5. start Nextcloud with firefox go http://localhost/nextcloud =>YES, it works!!!
  6. check if there is a config.php file =>YES!

So, thanks to your hint we know now that SELinux is the problem.

Next issue:

  1. after a restart, SELinux is active again
  2. Nextcloud does NOT work and gives the same error again…

So how do we set it permanently?
Thank you again for your great help.

@flint Likely a bug report, but did you try the autorelabel?

autorelabel?
No, don’t know that. Have to find out…

What I also found is this:
https://docs.nextcloud.com/server/stable/admin_manual/installation/selinux_configuration.html

I have to checkout both. Will report back…

@flint I would recommend a bug report, this will likely get the issue resolved, or advise on the implementation.

Perhaps @rfrohl can offer advice.

Have you ever tried Nextcloud via server:php:applications?
Does Nextcloud run under SELinux with that?
According to the Nextcloud documentation, it should.

I created a

bug report:
https://bugzilla.opensuse.org/show_bug.cgi?id=1261535

I also tested:

  1. tried to put in these instructions https://docs.nextcloud.com/server/stable/admin_manual/installation/selinux_configuration.html
    =>error
  2. tried autorelabel according to https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/using_selinux/changing-selinux-states-and-modes_using-selinux =>no change

at all =>no success.

1 Like

Compare:

I also did a fresh & up-to-date installation of Fedora,
then

  1. install apache2, mysql, mariadb and nextcloud
  2. sudo systemctl start apache2, mysql, mariadb
  3. firefox go http://localhost/nextcloud

=>works perfect / all ok !

1 Like

Change the security=selinux kernel parameter to security=.

Not sure if it’s still the same on Leap 16.0, but it used to be in GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, then sudo grub2-mkconfig -o /boot/grub2/grub.cfg.

@shundhammer why disable SELinux, better to report and sort out a fix for Apache?

I could tell you a hundred reasons why to disable it, but I won’t…

your change would mean that this turns off SELinux permanently? Correct?

If yes:
If I have the choice between two OS (Leap vs Fedora) and one is telling me to turn off a security level to run nextcloud and the other is showing that both is possible, higher security and nextcloud, I would not choose lower/less security…

Fedora:
see above and $getenforce =>enforcing

This looks like a solution:
https://www.linux-club.de/forum/t/nextcloud-einrichten-leap-16.125121/

sudo chcon -R -t httpd_sys_content_rw_t /srv/www/htdocs/nextcloud

I tested it and it works. It’s also stable and after a restart it still works !
I don’t really understand what it’s really doing… but:

$ getenforce =>enforcing / ok !
firefox go http://localhost/nextcloud =>works !

Update:
Nextcloud is running and you can create admin & user accounts, but it still needs a lot of work because there were many errors…

You still need to check out all the descriptions here
https://docs.nextcloud.com/server/stable/admin_manual/installation/selinux_configuration.html
and to find the right commands for you…

You’re not answering my question. For whatever reason. But what you’re saying is wrong. Because the server:php: applications package works perfectly. And without any errors.

Please tell me what to put in for

  • server
  • php
  • application

What address?

server:php: applications is the name of the repository.

zypper addrepo https://download.opensuse.org/repositories/server:php:applications/16.0/server:php:applications.repo

zypper refresh

zypper install nextcloud

We have an answer from bugs.opensuse
https://bugzilla.opensuse.org/show_bug.cgi?id=1261535

So question:
What are the next steps from all these comments in bugs.opensuse and from these new updates?

(I am not so familiar with this…)
Thanks for your help!