Nextcloud configuration

  • hello all,


    I want to setup two different nextcloud on two different PC and using two different subdomain on the same network with swag. Is that possible ?
    What would be the swag configuration ? the nextcloud yaml ?

    I saw that we can use EXTRA_DOMAINS= in the swag.yaml


    Any recommandation before starting setup this ?

    Thanks for help !

    • Official Post

    You can have two instances of Nextcloud (or any other service) on the same network. All you need is a proxy that points different domains to different ports on your server.

    I'm not sure how to do that with swag, but I guess it shouldn't be a problem.

  • Only 1 swag running

    2 reverse proxies with different subdomain and edited to point to LAN IP instead of hostname

  • Thanks for your help, i managed to do it everything is working with swag.

    But i have an issue with nextcloud :

    • One or more mimetype migrations are available. Occasionally new mimetypes are added to better handle certain file types. Migrating the mimetypes take a long time on larger instances so this is not done automatically during upgrades. Use the command `occ maintenance:repair --include-expensive` to perform the migrations.

    When i use the command : occ maintenance:repair --include-expensive i got this :


    Seems there is no error but the issue is still here in nextcloud even when restarting the container.


    Any idea please ?

  • Any idea please

    It's fixed in the latest version of NC


    There's a lot of posted issues on GitHub regarding it

  • Thanks didn't see it my bad, i made the update of nextcloud and the issue was gone.

    But after i got too many resquest page and then now i can't acces to nextcloud with my domaine nextcloud.***.duckdns.org (i'm not a robot) and even with the local adress 192.168.1.94:450 (400 bad request)

    The other nextcloud instance is working trougth the other domain and local ip

    I changed nothing since the update i don't understand.




    here is the config.php of nextcloud :


    Thanks for the help !

  • Update now with my domain i got this error :


    Internal Server Error

    The server is unable to process your request.

    If this happens again, please send the technical details below to the server administrator.

    The server log file may provide more information.

    Technical Details

    Remote address: 192.168.1.254

    Request ID: lCMdvrC3Tysy1mAN4ZlT

  • 'trusted_proxies' => array ( 0 => '192.168.1.96', ),

    Let me try to understand this:

    You have SWAG and NC running on an IP, and another NC running on a different IP.

    On the config.php of the isolated NC, the trusted proxy needs to be the SWAG IP since that's where the hops are comming from.


    What I don't understand is your subdomain.config:

    The fact that you used the complete URL means you complicated things and didn't do a 2x subdomain.config (one for each NC instance).


    All it takes is to have SWAG using a SUBDOMAIN=wildcard and creating 2x subdomain.conf but each, with a single name:

    For eg:

    The NC that is running on the same IP of SWAG can be the default nextcloud.subdomain.conf while the isolated NC can be copy/paste of the previous but named nextcloud_other.subdomain.conf.

    This would have to be edited accordingly to match that name, like:


    Code
    server {
    -----------
        server_name nextcloud_other.*;
    ---------------
            set $upstream_app 192.168.1.96; # IP of NC instance
            set $upstream_port 443; # It's PORT 443, NOT 450
            set $upstream_proto https;
            proxy_pass $upstream_proto://$upstream_app:$upstream_port;
    ----------------------------


    This implies that the YMLs are properly done and the both config.php are also matching the proper trusted_domain &&

    trusted_proxy

  • Thanks for your reply i will do it like that, before your reply i managed to remake all my setup with clean install and now everything work correctly with the previous swag config i only have cron issue :


    {"reqId":"SewCUJhWaN8vJHz6YGyc","level":3,"time":"2024-09-16T18:25:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/app/www/public/lib/base.php","line":723,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/app/www/public/lib/base.php","line":1189,"function":"init","class":"OC","type":"::"},{"file":"/app/www/public/cron.php","line":58,"args":["/app/www/public/lib/base.php"],"function":"require_once"}],"File":"/app/www/public/lib/base.php","Line":284,"message":"Not installed","exception":{},"CustomMessage":"Not installed"}}




    that i'm searching how to fix it . But i will do what you said on the swag conf.

  • Hi, after trying a nextcloud update, I had problems. Final decision I deleted containers and reinstalled everything. After installing the same stack I get this error:


    Error while trying to create admin account: An exception occurred in the driver: SQLSTATE[HY000] [1130] Host 'nextcloud.swag_default' is not allowed to connect to this MariaDB server


  • Why even such a complicated way? Different IPs? Different ports? Na. You can just do a normal nextcloud behind swag setup. Name the swag config file like nextcloud1.subdomain.conf and let it point to docker container named nextcloud1. You can do this for hundreds of nextcloud containers. All you need is a swag config file for each.

  • Hello guy, anyone can help me with this error :


    {"reqId":"SewCUJhWaN8vJHz6YGyc","level":3,"time":"2024-09-16T18:25:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/app/www/public/lib/base.php","line":723,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/app/www/public/lib/base.php","line":1189,"function":"init","class":"OC","type":"::"},{"file":"/app/www/public/cron.php","line":58,"args":["/app/www/public/lib/base.php"],"function":"require_once"}],"File":"/app/www/public/lib/base.php","Line":284,"message":"Not installed","exception":{},"CustomMessage":"Not installed"}}



    i'm trying since 2 days i don't understand how to fix it.

    thanks

  • Sorry if I'm writing again but I haven't been able to install nextcloud with Mariadb for days.

    After an update everything went wrong.

    I deleted everything: images, docker, everything. Starting from scratch with this stack:


    Deploy the stack ok but when go to :450 page for first seup i have error like in snap.


    log of container nextclouddb

    Code
     -1 }">2024-09-29 12:11:06 0 [Note] Starting MariaDB 10.11.8-MariaDB-log source revision 3a069644682e336e445039e48baae9693f9a08ee as process 186
     -1 }">2024-09-29 12:11:06 0 [ERROR] mariadbd: File '/config/log/mysql/mariadb-bin.index' not found (Errcode: 13 "Permission denied")
     -1 }">2024-09-29 12:11:06 0 [ERROR] Aborting


    please help me....

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!