Creating a second instance on the same server

Hi,

I have Nextcloud on running on an Ubuntu 23.10 server with Apache2 virtual hosts.(LAMP). I had previously duplicated the instance to a second server. I have 5 hosts. They all work fine except the second cloud.

/
/webmin
/zoneminder
/firstcloud
/secondcloud

It worked fine and I’m trying to do it again (lost it - don’t ask) but I’m missing something.
I’ve duplicated the first instance in /var/www/html, created the new virtual host, duplicated the mysql database, and updated the /config/config.php.

The index.html is being read, loads index.php, but then sends me to the 500 page. FYI - all sites use SSL (let’s encrypt) from the base URL. I checked the log and error log for this instance and there is nothing in them.

Does anyone have any hints as to what I may be missing?

When I inspect the network traffic I see this:

X Refused to execute script from 'https://***REDACTED***.org/cloud/index.php/js/core/merged-template-prepend.js?v=0a4006a4-25' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Maybe something to do with the csrftoken? But I honestly do not know what that is.

So you have simply cloned the instance?
But every instance needs its own instanceid etc. Is that what you did under the point


Normaly every instance need its own bootstrapping, so must be set up for its own. Simply cloning is not enough.


ernolf

1 Like

So I tried this again with success for 3 different instances.
I’m not sure what I was doing wrong before.

The steps are relatively simple:

  1. Create an Apache virtual host directory for each instance
    /var/www/html/firstcloud/
    /var/www/html/secondcloud/

  2. Create Apache virtual host config files for each instance, and enable them
    /etc/apache2/sites-available/firscloud.conf
    /etc/apache2/sites-available/firstcloud-ls-ssl.conf
    /etc/apache2/sites-available/secondcloud.conf
    /etc/apache2/sites-available/secondcloud-le-ssl.conf

    Be sure to add an alias line in the non-secure config like
    Alias /fristcloud “/var/www/html/firstcloud”

  3. Create a unique mysql database for each cloud. I copied the original database and the added a new user and “ALLOW ALL” for that user.

  4. Edit the /var/www/html/firstcloud/config/config.php to point to the correct locations, server names, and mysql databases.

It worked just fine.