• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Nextcloud accessible through two subdomains

TheColin21

New Pleskian
Hi,
I have a Plesk Installation on Ubuntu 20 with MariaDB, Apache and Nginx. There are several domains running on this server, which each have some subdomains.
Of of those domains hast an up-to-date Nextcloud-installation on it, in the subdomain cloud.example1.com.
I have a second domain, example2.com and I would like to make the same Nextcloud accessible through cloud.example2.com - not just through a redirect. I want the domain cloud.example2.com access the same website, database and so on, as cloud.example1.com.

Is this even doable? And if so, how?

Best regards
Colin P
 
You could create cloud.example1.com as a separate domain (not subdomain) and create alias cloud.example2.com for this domain.
 
No, if you do not check the 301 redirect checkbox on the Alias, it's a real alias for the main domain, there is no redirect involved. The domain simply opens the same document root path like the parent.
 
Thanks a lot. Is there an "easy" way of moving cloud.example1.com (subdomain) to a "full" domain? I can imagine that quite a lot could go wrong trying to copy it back and forth.
 
No, it is not possible to upgrade a subdomain to a full domain. You need to backup your data, remove the domain and add it again with the "add domain" button, the restore the backup. The database can be retained, but the files must be moved out of the path. However, if you retain the name of the path, moving the backup into the same path after re-adding the domain will save you all other efforts like setting new configuration variables in the Nextcloud config file. It's not a difficult process, just make sure you have saved all files to a separate, safe location before you remove the domain.
 
Does that mean, that I can save the contents of " /var/www/vhosts/system/cloud.example1.com" and by restoring it afterwards I get the complete configuration of my domain again?
 
No, I meant the content. That will normally reside in /var/www/vhosts/<main domain>/<subdomain>. You move <subdomain> to anything like <temporary>, then you remove the current subdomain configuration, re-create it with the "add domain" function an give it the same <subdomain> document root as the subdomain had before. Then you delete the new, empty <subdomain> folder and move <temporary> back to <subdomain>. This will retain all Nextcloud data and configuration.

The /var/www/vhosts/system/<domain> directories are for web server and some other configuration files only. These are auto-attended and should not be edited manually.
 
You're completely right, this will keep all Nextcloud data and configuration. What about my Apache/Nginx/PHP configuration though? That's quite a lot too.
 
Back
Top