Port and Apache Settings

Hello NC community

I’m noob and used this tutorial https://pimylifeup.com/raspberry-pi-nextcloud-server/ to get me started on Pi and NC. I’m struggling with getting remote access to my NC. My port settings and DDNS are:

  1. On Dynu DNS service, I set my domain as mycloud.freedns.org and point it my IP address 11.22.33.44
  2. I further configured port forwarding in Dynu service as port.mycloud.freedns.org to http://11.22.33.44:444. Also, I added url forwarding with urlfwd.mycloud.freedns.org to https://11.22.33.44:444/nextcloud
  3. On my router, I opened port 444 to my LAN IP port 443. The reason I used 444 is that my ISP seems to have blocked the router such that I can’t use the OEM’s router admin page and I have to use the ISP’s app to port forward. If I try http://11.22.33.44:443 I get the OEM’s router log in and I don’t have the admin password to configure it. Port 80 on router is also forwarded to internal port 80
  4. My /etc/apache2/port2.conf is:
Listen 80
<IfModule ssl_module>
        Listen 443
</IfModule>
<IfModule mod_gnutls.c>
        Listen 443
</IfModule>
  1. My /etc/apache2/sites-available/000-default.conf is:
<VirtualHost *:80>
   ServerAdmin example@example

   RewriteEngine On
   RewriteCond %{HTTPS} off
   RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
  1. Lastly, in my /var/www/nextcloud/config/config.php, I have the trusted domains:
     0 => '<myLAN IP>',
     1=> 'mycloud.freedns.org',
     2=> 'port.mycloud.freedns.org',
     3=> 'urlfwd.mycloud.freedns.org'

Outcomes:

  1. Using port.mycloud.freedns.org gets me to error “Apache/2.4.51 (Raspbian) Server at 127.0.1.1 Port 443”
  2. Using urlfwd.mycloud.freedns.org gets me to NC’s “Access through untrusted domain”
  3. Using mycloud.freedns.org

Nextcloud version : 22.2.0
Operating system and version : Raspbian Buster on RPi 4B
Apache or nginx version : 2.4.51
PHP version : 7.4

So what am I missing or doing wrong?

Welcome to userforums of NC.

As you yourself described you as being an rookie with NC and Pi I would like to suggest a well proven tool to you which covers exactly your usecase. It’s called nextcloudpi (ncp) and could be downloaded for free from nextcloudpi.com

Usually it installs very smoothly and helps you setting up your instance danely.

Of course it’s official part of the nc-verse and comes for free

Thanks Jimmy

The reason I wanted to stay with Raspbian is that I’d still like to use the Pi with it’s desktop for other development work.

Using NCP, I’ve now managed to access it with the ddns URLs, even on mobile browsers, but can’t get in via Android app. I suppose I’ll need SSL certs from Letsencrypt?

If it’s better to remain on NCP, how can I get a desktop environment? I tried installing Xorg, raspberrypi-mods and lightdm but I’m getting a blank screen with a solitary cursor at the top of the screen

You could use a Debian image for Raspberry Pi, which comes with a desktop environment, and install NCP with a script # curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash .

1 Like