[Support] Linuxserver.io - Nextcloud


Recommended Posts

On 7/1/2017 at 4:46 PM, zandrsn said:

 

Also, after I setsetup my nextcloud via http and set up a letsencrypt reverse proxy (following the LS guide), when I try to access my nextcloud Webui I just get the default index page instead of the nextcloud Webui:


Welcome to our server

The website is currently being setup under this address.

For help and support, please contact: [email protected]

or, if I get rid of my default letsencrypt ngix site-conf and just leave the nextcloud conf, when I try to open my nextcloud WebUI (via my Unraid dashboard), I get a https version of my nextcloud.server.com page that times out ERR_TIMED_OUT.

Do I need to change anything in my default site-conf file to be able to access my nextcloud ui or is this a problem with https access on my server perhaps?

Just bumping this to see if anyone has an idea. Thanks.

Link to comment

Hey guys,:
 

I just tried to install Nextcloud following the guide here, but I have a problem with Maria Db. In the Web UI I can not create dbuser and connect to database.

I have this error code:

Error while trying to create admin user:
Failed to connect to the database:
An exception occured in driver:
SQLSTATE[HY000][2002] Connection refused

 

How can I connect to that database in the docker container?

Which additional settings do I need?

 

I googled but did not find any satisfying answer.

Link to comment
16 hours ago, CHBMB said:

Only thing I got is you missed a step in the guide or didn't get something quite right.  Beyond that it's impossible to say.

 

Okay, I tried installing three times following all of the steps, but I may have messed something up. I will try again this weekend when I have more time and document each step along the way and share my process to see if I'm missing anything. 

Link to comment

Okay here goes the new install from scratch... Again, everything works as expected until the final step of actually accessing my Nextcloud container via https://nextcloud.mydomain.com. I have a sense that this might be because of a problem accessing my server via https (I noticed this with OpenVPN-as also, but thought it was just something to do with that container), but I'm not sure. I've detailed every step of my process below (basically repeating the LinuxServer guide). Any help would be very much appreciated. I'm at a total roadblock with this. 

 

1. I first installed mace's DDclient container, and used it to point my namecheap domain at my unraid server via an a name dynamic DNS record.

2. I then installed LetsEncrypt from community apps with these settings:

Letsencrypt_config

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And forwarded ports 80 > 81 and 443 > 443 in my router. 

 

3. I then installed the LS MariaDB container from community apps using these settings:

 

mariadb.jpg.9471cd3bb27322d98ed528357afd11b6.jpg

 

I removed the # from line 124 of my mariadb custom.conf file, so that it read "bind-address=0.0.0.0" and restarted mariadb.

 

I then created my Nextcloud database using these commands:

docker exec -it mariadb-nextcloud bash

mysql -uroot -p

CREATE USER 'admin' IDENTIFIED by 'password'; 

CREATE DATABASE IF NOT EXISTS nextcloud;

GRANT ALL PRIVILEGES ON nextcloud.* TO 'admin' IDENTIFIED BY 'password';

 

4. I then added Nextcloud from community apps using these settings:

 

nextcloud.jpg.b421f16c5b75199c0ab3de9705ce0386.jpg

 

At this point, after the container installs, when I try to access the Nextcloud webui at https://192.168.1.107:444/ I receive a privacy error (NET::ERR_CERT_AUTHORITY_INVALID) and have to allow the webui to load "not secure" (non-https) in order to access it.

 

I continue and set up nextcloud via the webui by:

Adding an admin username and an admin password.

Adding the information for my MariaDB user, password, and nextcloud database name (nextcloud), and replacing localhost with my Unraid ip address and MariaDB port (192.168.1.107:3306).

 

After finalizing the setup I am able to access the Nextcloud webui, though the connection is still 'not secure' (meaning, I assume, http rather than https). 

 

5. I then setup my letsencrypt reverse proxy to allow access to nextcloud via https://nextcloud.mydomain.com by first going to mnt/cache/appdata/letsencrypt/nginx/site-confs and creating a file called nextcloud with the code:

server {  
    listen 443 ssl;
    server_name nextcloud.mydomain.com;

    root /config/www;
    index index.html index.htm index.php;

    ###SSL Certificates
    ssl_certificate /config/keys/letsencrypt/fullchain.pem;
    ssl_certificate_key /config/keys/letsencrypt/privkey.pem;

    ###Diffie–Hellman key exchange ###
    ssl_dhparam /config/nginx/dhparams.pem;

    ###SSL Ciphers
    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';

    ###Extra Settings###
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;

        ### Add HTTP Strict Transport Security ###
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
    add_header Front-End-Https on;

    client_max_body_size 0;

    location / {
        proxy_pass https://192.168.0.1:444/;
        proxy_max_temp_file_size 2048m;
        include /config/nginx/proxy.conf;
    }
}

I then edited the file mnt/cache/appdata/nextcloud/www/nextcloud/config/config.php to say:

<?php
$CONFIG = array (
 'memcache.local' => '\\OC\\Memcache\\APCu',
 'datadirectory' => '/data',
 'instanceid' => 'xxxxxxxxxxxx',
 'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
 'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
 'trusted_domains' => 
 array (
 0 => '192.168.0.1:444',
 1 => 'nextcloud.mydomain.com',
 ),
 'overwrite.cli.url' => 'https://nextcloud.mydomain.com',
 'overwritehost' => 'nextcloud.mydomain.com',
 'overwriteprotocol' => 'https',
 'dbtype' => 'mysql',
 'version' => '11.0.1.2',
 'dbname' => 'nextcloud',
 'dbhost' => '192.168.0.1:3305',
 'dbport' => '',
 'dbtableprefix' => 'oc_',
 'dbuser' => 'admin',
 'dbpassword' => 'xxxxxxxxxxxxxxxxxxxx',
 'logtimezone' => 'UTC',
 'installed' => true,
 );

6. Finally, I restarted both the letsencrypt and nextcloud containers and try to access Nextcloud via https://nextcloud.mydomain.com. The page tried to load for a long time before eventually displaying the message "502 Bad Gateway", and the same thing happens if I try to select "webui' from my Unraid dashboard. If I try to access Nexcloud via 192.168.1.107:444 I get the message "400 Bad Request - The plain HTTP request was sent to HTTPS port", and if I try https://192.168.1.107:444 I get the same 502 Bad Gateway timeout. 

 

Edited by zandrsn
Link to comment
On 7/9/2017 at 3:44 AM, CHBMB said:

I'm away from home for a week on a family holiday, I'll try and VPN home at some point and take a look, thanks for taking the time and effort to post the steps, helps enormously.

Sent from my LG-H815 using Tapatalk
 

Thank you for taking the time to read through it all! I patiently await any insights you might have. Just in case this helps at all, I will share some additional observations re; https

 

I have OpenVPN-as set to allow access and management to my Unraid server when I'm outside my home network. Whenever I try to access the OpenVPN-as admin/connect UI (from inside my home network) I'm only able to access it via http, as https always fails to connect. I always thought that this was just a quirk of that particular container, but now that I'm also unable to access the nextcloud setup UI via https, and nextcloud.mydomain.com also fails (either because it times out and says 502 Bad Gateway - with https://nextcloud.mydomain.com, or because it says that I'm trying to access an https port with http - with http://nextcloud.mydomain.com). I'm now starting to wonder if the root of my problem setting up Nextcloud, or at least accessing it once it is set up, has to do with security certificates and being unable to access containers on my server via https.... This is way outside my knowledge base, so I'm not sure how to fix this or even further diagnose if this is the case, but this is what I've been observing at least. 

Link to comment

I haven't used NextCloud for some time now, and was just getting it back up and running.  However, when I try to connect to the WebUI, I get this error:

 

This version of Nextcloud is not compatible with PHP 7.1.
You are currently running 7.1.5.

 

Can anyone give me some insight into what happened?  It is up to date as is MariaDB.

Link to comment
48 minutes ago, yukonhijack said:

Ugh, ok, I did some searching and realized I had to manually update Nextcloud using the guide on page 1.  However, I must have been pretty out of date because when I get to the upgrade part, I get this error:

Exception: Updates between multiple major versions and downgrades are unsupported.

Update failed

 

So, do I just need to nuke the install or is there an easier way to upgrade to this most recent version?

 

 

48 minutes ago, yukonhijack said:

 

I haven't used NextCloud for some time now, and was just getting it back up and running.  However, when I try to connect to the WebUI, I get this error:

 

This version of Nextcloud is not compatible with PHP 7.1.
You are currently running 7.1.5.

 

Can anyone give me some insight into what happened?  It is up to date as is MariaDB.

 

Link to comment

Hi everyone. I'm seeing these errors that were discussed here. I read the setup guide from CHBMB but did not see anything about those headers.

 

It seems like these headers are duplicated across letsencrypt-nginx and nextcloud, hence the error:

 

  • The "X-XSS-Protection" HTTP header is not configured to equal to "1; mode=block". This is a potential security or privacy risk and we recommend adjusting this setting.
  • The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.
  • The "X-Robots-Tag" HTTP header is not configured to equal to "none". This is a potential security or privacy risk and we recommend adjusting this setting.
  • The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.

 

Will commenting out the headers in letsencrypt-nginx fix the errors?

Link to comment

I recognize I am pretty bad at this stuff, but I decided to nuke all existence of Nextcloud and Mariadb, and reinstalled both according to the guide.  However, I cannot access my Mariadb at all.  I tried going through the WebUI setup in Nextcloud, but I get that pesky error about failing while trying to create an admin user (password="YES").  I KNOW I am entering the password correctly.  I tried going into Mariadb via terminal and issuing it:

 

mysql -uroot -p

 

But it still won't accept my password.  I get an error:

 

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

 

What am I missing here?

Link to comment

I can't offer any explanation other than the password isn't right.

 

Try again and use a simple password like, password.   You must remove the container, image and appdata though.  The root password is set at the time the container is created and can't be changed afterwards.

Edited by CHBMB
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.