Port Change from 80 to 800

Wondering if someone can point me in the right direction regarding Apache or Nextcloud configuration, I have changed the port of my Nextcloud server from 80 to 800.

  1. Modified the listen line in ports.conf file from 80 to 800
  2. Modified the VirtualHost from 80 to 800
  3. I did read that changes (in step 2) were also required in etc/apache2/site-available/nextcloud.conf – however, I did not have that line in my file. (Change port 443 and 80)
  4. Restart apache

**symbolics links in etc/apache2/sites-anabled to the files below.

I can not access the Nextcloud site (http://mynextcloud:800/nextcloud) when I am on the local LAN Even though the DNS routes correctly as I get a response when I ping mynextcloud by IP address or by name. I went a step further and change the DNS entry on the local PC to 1.1.1.1 (got a reply)

When I not on the local LAN (from work) I can access http://mynextcloud:800/nextcloud from a webpage and from the PC Client Nextcoud app once I modified the configuration file to us se port 800 .

Thank you in advance.

System Info
Nextcloud 16.0.5.1
Ubuntu 18.04 LTS
Apache 2.4.29
PHP 7.2.24

Etc/apache2/Ports.conf
Listen 800

Listen 443 Listen 443

Etc/apache2/Site-Available/000-default.conf
<VirtualHost *:800>

Etc/apache2/Site-Available/nextcloud.conf
Alias /nextcloud “/var/www/nextcloud/”
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All

Dav off

SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud

I think your problem has nothing to do with changing the port to 800. Does it work if you use the local IP instead of the domain name?

DNS routes correctly as I get a response when I ping mynextcloud by IP address or by name. I went a step further and change the DNS entry on the local PC to 1.1.1.1 (got a reply)

Does it point to the internal or the external IP if you ping it? In order for it to work with external IP/DNS, your router has to support NAT-Loopback/Hairpinning. Some routers have “out of the box”-support for NAT-Loopback, on others you have to activate it and some routers don’t support it at all.

If your router does not support it you can run a local DNS server on a separate device like a raspberry pi. Something like Pi-hole would probably be the easiest way to do that. Or you can edit the hosts file on your computer to override the dns. Not possible on android or iOS as far as i know.

Please look if apache2 is really listen on port 800

netstat -tulpen
netstat -an |grep 800

Does it work if you use the local IP instead of the domain name? actually it connected from chrome when using the IP, to my surprise.

I also do have an Internal DNS server used internally first before it goes out. I do have 1.1.1.1 as an alternate in the config (i will try to remove that it see if the issues is address.)

Not sure if NAT-Loopback/Hairpinning is an issues (Will Double check though) since it was working on port 80. first I will try to override on the host file.

Will report back this afternoon.

Thank you again for the assistance.

netstat -tulpen
tcp6 0 0 :::800 :::* LISTEN 0 24621 1395/apache2

netstat -an |grep 800

tcp 0 0 10.100.40.3:48800 45.33.73.250:443 ESTABLISHED
tcp6 0 0 :::800 :::* LISTEN
tcp6 0 0 10.100.40.3:800 38.88.183.195:51140 TIME_WAIT
tcp6 0 0 10.100.40.3:800 38.88.183.195:51101 TIME_WAIT
tcp6 0 0 10.100.40.3:800 38.88.183.195:51115 TIME_WAIT
tcp6 0 0 10.100.40.3:800 10.100.40.11:49899 SYN_RECV
tcp6 0 0 10.100.40.3:800 10.100.40.11:49876 SYN_RECV
tcp6 0 0 10.100.40.3:800 10.100.40.11:49914 SYN_RECV
tcp6 0 0 10.100.40.3:800 38.88.183.195:51160 FIN_WAIT2
tcp6 0 0 10.100.40.3:800 38.88.183.195:51120 TIME_WAIT
tcp6 0 0 10.100.40.3:800 38.88.183.195:51082 TIME_WAIT
tcp6 0 0 10.100.40.3:32400 104.162.141.162:48003 ESTABLISHED
tcp6 0 0 10.100.40.3:800 38.88.183.195:51117 TIME_WAIT
tcp6 0 0 10.100.40.3:800 38.88.183.195:51156 TIME_WAIT
tcp6 0 0 10.100.40.3:800 10.100.40.11:49819 TIME_WAIT
tcp6 0 0 10.100.40.3:800 10.100.40.11:49837 SYN_RECV
tcp6 0 0 10.100.40.3:800 10.100.40.11:49856 TIME_WAIT
tcp6 0 0 10.100.40.3:800 10.100.40.11:49892 TIME_WAIT
tcp6 0 0 10.100.40.3:800 10.100.40.11:49862 SYN_RECV
tcp6 0 0 10.100.40.3:800 38.88.183.195:51157 TIME_WAIT

I also do have an Internal DNS server used internally first before it goes out. I do have 1.1.1.1 as an alternate in the config (i will try to remove that it see if the issues is address.)

Not sure if NAT-Loopback/Hairpinning is an issues (Will Double check though) since it was working on port 80. first I will try to override on the host file.

What DNS-Server are you using? I still think it’s a DNS issue. What you need is a proper split DNS configuration.

On your internal DNS server:

  • Configure a host override entry, that points to the local address of your nextcloud server, so that local clients receive the configured response instead of the response from the upstream DNS servers.
  • Specify the gateway/router address or an external DNS server like 1.1.1.1 as upstream DNS server.

On your DHCP-Server (usualy your router):

  • Make sure that your DHCP server announces the address of your internal DNS server to all clients and that the clients only use the internal server for DNS requests.

What DNS-Server are you using? -
This is MS Server with DNS as the primary. Nothing out of the ordinary.

Not sure what the problem is here. I modified the local host file and sometimes got connected via chrome but was not able to authenticate with the PC client. Definitely not working as expected.

After wasting a good portion of my afternoon, I tried MS internet explorer and was able to connect and use the PC Client link to authenticate the client. Appear to be a Chrome issue or a Chrome/MS DNS problem. I am going to see if i dig dipper and get to the bottom of this. Make no sense!

I’m not very familiar with windows server, but maybe this will help to point you in the right direction…

https://social.technet.microsoft.com/Forums/windowsserver/en-US/3adae309-7499-41d8-a980-505f90276aa3/how-do-i-override-dns-for-local-network-without-editing-hosts-files-on-ever-machine?forum=winserverNIS