How to use terminal to access logs

Look for used ports:
netstat -tulpe

admin@nextcloud:~$ netstat -tulpe
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 localhost:mysql 0.0.0.0:* LISTEN mysql 26309 -
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN root 50538 -
tcp 0 0 localhost:5939 0.0.0.0:* LISTEN root 31291 -
tcp 0 0 localhost:domain 0.0.0.0:* LISTEN systemd-resolve 18708 -
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN root 29595 -
tcp 0 0 localhost:ipp 0.0.0.0:* LISTEN root 24935 -
tcp6 0 0 [::]:ssh [::]:* LISTEN root 29599 -
tcp6 0 0 [::]:44759 [::]:* LISTEN admin 36654 3558/apache2
tcp6 0 0 localhost:ipp [::]:* LISTEN root 24934 -
udp 0 0 localhost:domain 0.0.0.0:* systemd-resolve 18707 -
udp 0 0 0.0.0.0:bootpc 0.0.0.0:* root 26331 -
udp 0 0 0.0.0.0:ipp 0.0.0.0:* root 23180 -
udp 0 0 0.0.0.0:60612 0.0.0.0:* avahi 23931 -
udp 0 0 0.0.0.0:mdns 0.0.0.0:* avahi 23929 -
udp6 0 0 [::]:56874 [::]:* avahi 23932 -
udp6 0 0 [::]:mdns [::]:* avahi 23930 -
admin@nextcloud:~$

You also can install lsof
sudo apt-get install lsof
and list the interfaces and programs
lsof -i
Not useful but you can learn something :wink:

You can keep Nginx if you want. Its very easy to migrate from nginx to apache if you change your mind later.
To install nginx, do :
sudo apt update
sudo apt upgrade

sudo apt install php7.3 php7.3-fpm php7.3-mysql php-common php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline php7.3-mbstring php7.3-xml php7.3-gd php7.3-curl

and :
php -r ‘echo PHP_VERSION; echo “\n” ;’

admin@nextcloud:~$
admin@nextcloud:~$ sudo apt-get install lsof
[sudo] password for admin:
Reading package lists… Done
Building dependency tree
Reading state information… Done
lsof is already the newest version (4.89+dfsg-0.1).
The following package was automatically installed and is no longer required:
libzip4
Use ‘sudo apt autoremove’ to remove it.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
admin@nextcloud:~$ sudo apt-get install lsof -l
E: Command line option ‘l’ [from -l] is not understood in combination with the other options.
admin@nextcloud:~$ sudo apt-get install lsof-l
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package lsof-l
admin@nextcloud:~$

correct command is (use cut and paste):
sudo lsof -i

first command working

I think this is not the right way to solve your problem.
With installation do you use?
Why do you use nginx and not apache2?

Installation for debian with apache2 to show the difference.

There are some reasons to take nginx and not apache. Its just a choice. I choose nginx because nginx was already installed on his server

so what does all that mean it listening to ports?
admin@nextcloud:~$ sudo lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd-r 937 systemd-resolve 12u IPv4 18707 0t0 UDP localhost:domain
systemd-r 937 systemd-resolve 13u IPv4 18708 0t0 TCP localhost:domain (LISTEN)
avahi-dae 1197 avahi 12u IPv4 23929 0t0 UDP *:mdns
avahi-dae 1197 avahi 13u IPv6 23930 0t0 UDP *:mdns
avahi-dae 1197 avahi 14u IPv4 23931 0t0 UDP *:60612
avahi-dae 1197 avahi 15u IPv6 23932 0t0 UDP *:56874
cupsd 1199 root 6u IPv6 24934 0t0 TCP localhost:ipp (LISTEN)
cupsd 1199 root 7u IPv4 24935 0t0 TCP localhost:ipp (LISTEN)
cups-brow 1507 root 7u IPv4 23180 0t0 UDP *:ipp
mysqld 1992 mysql 29u IPv4 26309 0t0 TCP localhost:mysql (LISTEN)
dhclient 2034 root 6u IPv4 26331 0t0 UDP *:bootpc
sshd 2368 root 3u IPv4 29595 0t0 TCP *:ssh (LISTEN)
sshd 2368 root 4u IPv6 29599 0t0 TCP *:ssh (LISTEN)
teamviewe 2382 root 11u IPv4 31291 0t0 TCP localhost:5939 (LISTEN)
teamviewe 2382 root 14u IPv4 30098 0t0 TCP nextcloud.ubuntu.com:44604->HK-HKG-ANX-R003.teamviewer.com:5938 (ESTABLISHED)
teamviewe 2382 root 17u IPv4 36346 0t0 TCP localhost:5939->localhost:38784 (ESTABLISHED)
TeamViewe 3227 admin 26u IPv4 36345 0t0 TCP localhost:38784->localhost:5939 (ESTABLISHED)
apache2 3558 admin 4u IPv6 36654 0t0 TCP *:44759 (LISTEN)
apache2 3560 admin 4u IPv6 36654 0t0 TCP *:44759 (LISTEN)
apache2 3561 admin 4u IPv6 36654 0t0 TCP *:44759 (LISTEN)
firefox 3849 admin 99u IPv4 57161 0t0 TCP nextcloud.ubuntu.com:32862->help.nextcloud.com:https (ESTABLISHED)
firefox 3849 admin 144u IPv4 44765 0t0 TCP nextcloud.ubuntu.com:54656->ec2-52-10-118-253.us-west-2.compute.amazonaws.com:https (ESTABLISHED)
nginx 4282 root 6u IPv4 50538 0t0 TCP *:http (LISTEN)
nginx 4285 www-data 6u IPv4 50538 0t0 TCP *:http (LISTEN)
nginx 4286 www-data 6u IPv4 50538 0t0 TCP *:http (LISTEN)
nginx 4288 www-data 6u IPv4 50538 0t0 TCP *:http (LISTEN)
nginx 4289 www-data 6u IPv4 50538 0t0 TCP *:http (LISTEN)
admin@nextcloud:~$

admin@nextcloud:~$ sudo apt install php7.3 php7.3-fpm php7.3-mysql php-common php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline php7.3-mbstring php7.3-xml php7.3-gd php7.3-curl
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package php7.3
E: Couldn’t find any package by glob ‘php7.3’
E: Couldn’t find any package by regex ‘php7.3’
E: Unable to locate package php7.3-fpm
E: Couldn’t find any package by glob ‘php7.3-fpm’
E: Couldn’t find any package by regex ‘php7.3-fpm’
E: Unable to locate package php7.3-mysql
E: Couldn’t find any package by glob ‘php7.3-mysql’
E: Couldn’t find any package by regex ‘php7.3-mysql’
E: Unable to locate package php7.3-cli
E: Couldn’t find any package by glob ‘php7.3-cli’
E: Couldn’t find any package by regex ‘php7.3-cli’
E: Unable to locate package php7.3-common
E: Couldn’t find any package by glob ‘php7.3-common’
E: Couldn’t find any package by regex ‘php7.3-common’
E: Unable to locate package php7.3-json
E: Couldn’t find any package by glob ‘php7.3-json’
E: Couldn’t find any package by regex ‘php7.3-json’
E: Unable to locate package php7.3-opcache
E: Couldn’t find any package by glob ‘php7.3-opcache’
E: Couldn’t find any package by regex ‘php7.3-opcache’
E: Unable to locate package php7.3-readline
E: Couldn’t find any package by glob ‘php7.3-readline’
E: Couldn’t find any package by regex ‘php7.3-readline’
E: Unable to locate package php7.3-mbstring
E: Couldn’t find any package by glob ‘php7.3-mbstring’
E: Couldn’t find any package by regex ‘php7.3-mbstring’
E: Unable to locate package php7.3-xml
E: Couldn’t find any package by glob ‘php7.3-xml’
E: Couldn’t find any package by regex ‘php7.3-xml’
E: Unable to locate package php7.3-gd
E: Couldn’t find any package by glob ‘php7.3-gd’
E: Couldn’t find any package by regex ‘php7.3-gd’
E: Unable to locate package php7.3-curl
E: Couldn’t find any package by glob ‘php7.3-curl’
E: Couldn’t find any package by regex ‘php7.3-curl’
admin@nextcloud:~$

the nginx is listening on port 80 (http) and not on 443 (https).
the apache2 is listening on port 44759 !!!???!!!

Sorry. no idea.
Perhaps test server

http://ip-or-name-to-server:44759
https://ip-or-name-to-server:44759

Is there a service?

admin@nextcloud:~$ sudo apt install php -r ‘echo PHP_VERSION; echo “\n”
E: Command line option ‘r’ [from -r] is not understood in combination with the other options.
“n”
admin@nextcloud:~$

am i doing it correctly

admin@nextcloud:~$ sudo apt install php ‘echo PHP_VERSION; echo “\n"

Have you changed the values or do you use a client with the name nextcloud.ubuntu.com?

Please again.
Please tell your nextcloud installation way.
Image? Download site? Instructions, …

I am not sure what you mean

question would i lose all my data if i was to reinstall it all again a fresh
we have a family server just with photos

so i would not like to lose those but if its to complex would it be better to start again

of course knowing that i am basically computer illiterate

the way its been setup is just on a thumb drive

maybe a new thumb drive might help
and a new setup

Its not normal you don’t have php7.3 version. php7.3 version is recommended by nextcloud documentation. What is your distribution (Debian, ubuntu) and his version (debian 8, 9 ?).

I think tha you have an old version. Doesnt matter :
try :
sudo apt install php7.2 php7.2-fpm php7.2-mysql php-common php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline php7.2-mbstring php7.2-xml php7.2-gd php7.2-curl

Then:
php -r ‘echo PHP_VERSION; echo “\n” ;’

You don’t need to reinstall all dont worry

He uses Ubuntu Xenial (16.04 LTS). Is it a problem?

Its not a problem but its the last version maintained. And it may explain why he doesnt have php7.3

Yes. Look at:
http://packages.ubuntu.com/php
https://packages.ubuntu.com/bionic/php

It is not necessary to install the php-version with dot.
It is ony necessary to install the meta paket “php”