Using the snap installed NextCloud as a webserver

I installed a snap instance of NextCloud on EC2 by following the instructions on:

i’m new to snap. Meaning, I used to install NextCloud using the script provided in the official website. In that case, I was able to also function my webserver by configuring apache.

But is so happens that I cannot configure nor start apache for obvious reasons; snap is running an instance of apache too.

So, in this case, what are my solutions to operate different sub domains in the same server?
Can I install a different software? NGIX? Or, is there a possibility to configure the apache instance inside SNAP itself?

I know this may be not recommended but I am trying to learn mu options. Thank you for your advices.

you could use different ports. e.g. port 81 and 444 for “snap nextcloud”. and port 80 and 443 for your “normal” webserver.

you can start as many apaches/nginx on your server as you like. they only can’t use the same port.

in your normal webserver you can setup “virtual hosts”. that is to say apache open port 80/443 but would act different if you request nextcloud.domain.tld or www.domai.tld.

if you decide to use snap you shouldn’t reconfigure the “snap webserver”. only use another ports than 80/443. you could configure the “normal” web server to act as a reverse proxy and listen to nextcloud.domain.tld:80 and route all this traffic to localhost:81 where the snap web server is listening.

got the idea?

if you understand that concept of installation and running different services on one machine you may have a look at docker. that’s what docker was made for.

Thank you for your time. I really like the concept your put forth. Interesting. Can you share with me few articles to learn how to get started to try it?

I am not sure if I will use snap. I’m a person who’s trying nextCloud these days but not with hopes to make money or anything, I just like its a great project and it helps me improve my skills in linux administration also liberate myself from Dropbox. I am making a gradual move. Not an abrupt one. I want to make sure I know my way around NextCloud before I take the big step. Using snap blocks me from leaning about NextCloud. Its sets everything for you which is great but not for me.

For that final step where I could route traffic via a reverse proxy to snap, do you have more technical words on it please? Perhaps a link? or a little more description about that process? I’m a bit confused there. I would love to learn that technique.

digital ocean always has nice tutorials.


or
https://www.leaseweb.com/labs/2014/12/tutorial-apache-2-4-transparent-reverse-proxy/

to do the same with nginx just ask google “nginx reverse proxy”. there also a lot of youtube videos about this matter.

Perhaps it is better to not use snap and not use docker.

Why do you not install Apache2, MariaDB, Nextcloud, Lets Encrypt … normally. It is really easy. Use virtual hosts like www.domain.tld, domain.tld (both for web) and cloud.domain.tld (nextcloud) all with Lets Encrypt certificate (certbot).