Nextcloud on subdomain

Hey guys,

first off, I noticed that this has been asked a few times but regardless of where I read, I either dont get it or it doesnt work. I just bought my own domain and now my plan was to use cloud.domain.com for my nextcloud and domain.com for a different page. My cloud listens to the cloud.domain.com but to the normal domain.com as well and Im too dumb to figure out how to change that and how to let domain.com be a different page. Again, I read through a few articles about this here already and didnt get it so… uh yeah. big idiot here that needs some foolproof instructions.

Would really appreciate it. If you need any config files or whatever, just let me know.

Nextcloud version (eg, 20.0.5): 21.0.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache2.4.41
PHP version (eg, 7.4): 7.4

You would create different virtual hosts in apache:
https://httpd.apache.org/docs/2.4/en/vhosts/examples.html#page-header

It’s the first example but instead of different domains you can have one vhost for example.com and the other one for could.example.com.
If you use placeholders such as ServerAlias *.example.net, you might want to check for a specific cloud.example.net vhost, in which order it has to be put.

Also check logfiles, some vhosts might not be used because of syntax errors.

Virtual hosts in Apache should solve it out.
You need to find it out on the net though, how to do it properly.
Needs some work but doable.