DietPi multiple web servers & Nextcloud

I just installed Nextcloud on my Raspberry Pi 3 B+ that I had lying around. So far it seems like it has a lot of potential.

There are some issues though.

I have another Raspberry Pi serving my website at https://chrisfoose.party

I would like to configure my other Pi so that my cloud is located at https://nextcloud.chrisfoose.party or something like that.

Luckily, my webpage comes up when I request it, but I think having two Apache instances is confusing my network.

I have the DietPi Apache to use ports 8080 and 4443. I have set port forwarding for these services. However, how would I go about configuring my Namecheap to set up the subdomain ‘nextcloud’? Furthermore, how would I configure SSL with my Nextcloud server?

If you have 2 SBCs, you do not need to configure the web server ports differently. To be able to access both web pages, you would have to set up one of your SBC as a reverse proxy. This function is available on most modern web servers such as Apache or Nginx. There are also special software applications that offer this function. The proxy can be configured to manage your SSL certificate and forward requests to the correct web application. This means that you only need to forward port 80/443 to your proxy and do not need to open any other ports. Reverse Proxy 101: What It Is, How It Works, Use Cases, & More (2023)

Okay, I kind of understand the concept.

I use Apache on both SBCs so I guess I’ll configure the one with ports 440 and 80 open to be the reverse proxy? Is that right or does it not have to be that one?

Is there a better software alternative to Apache for this?

Also, I am still confused about how exactly to set up the subdomain.

Thank you for your help.

I guess a typo :smiley: should be 443 and not 440

depends on your knowledge and the willingness to learn how to setup and configure Apache as revers proxy :smiley:

There are tools available having a UI where you can configure everything and don’t need to deal with configuration files. Something like NPM - Nginx Proxy Manager is user friendly. However it will require Docker as it is a container. And it will block port 80/443 for its own usage. Therefore Apache need to be moved away to port 8080 (or similar) and you would need to remove SSL handling from Apache as this will be taken over by NPM. Personally that’s the setup I use to reach different web apps via a revers proxy.