[SOLVED] Can't access apach2 Ubuntu Default Page using DDNS FQDN

avdol

Member
Mar 6, 2021
14
2
8
33
I currently have an ubuntu LXC installed on my proxmox server in order to setup a nextcloud service.
In order to do this I am following this learnlinux youtube guide here.
At 5:09 the guide mentions changing the hostname and hosts to include my ddns or domain name.

I have done the same and I have also configured the container so that proxmox doesn't change the settings by issuing the following commands
touch /etc/.pve-ignore.hosts
touch /etc/.pve-ignore.hostname

I have also opened the ports 80 and 443 to the container ipaddress on my router. The ddns service is also enabled on my router.

however when I try to access the Ubuntu Default Page using my ddns domain name it doesn't work. Although accessing the Ubuntu Default Page using the ip address of the container work.

Below is what my hosts and hostname configuration files currently look like.
1615116540413.png
1615116579974.png
 
Last edited:
The combination <ip address> <name> needs to be in every machines /etc/hosts which tries to connect to your service.
Alternatively you can instruct your gateway/dns server to give back the correct ip address.
How else is the machine supposed to know under which address your container is reachable by the desired name?
 
The combination <ip address> <name> needs to be in every machines /etc/hosts which tries to connect to your service.
Alternatively you can instruct your gateway/dns server to give back the correct ip address.
How else is the machine supposed to know under which address your container is reachable by the desired name?

Sorry I'm to the world of linux so please bear with me.

The only container I have is the ubuntu container on which I wish to install nextcloud.
I followed the nextcloud youtube guide and got to the part where you enter the container's ipaddress into a web browser to access the apache2 default page which worked for me.
What didn't work was when i entered mydomainname.ddns.net I couldn't reach the apache2 default page

I've not setup any other machine so I am unclear as to what you mean by "The combination <ip address> <name> needs to be in every machines /etc/hosts which tries to connect to your service." Could you please elaborate as I may misinterpreted your instruction
 
I meant the machine with which you try to reach Nextcloud, your computer probably. If there is no dns server in your network which returns the IP address upon entering the name, the computer has to know the IP address by itself. With linux this can be achieved via the file /etc/hosts
With Windows you can edit %windir%\system32\drivers\etc\hosts to achieve the same effect.
 
I've attached a copy of the etc/hosts config above. What do i need to add for the dns server?

Note that whist setting up the containerI specified a dns server
1615128774245.png
 
That's Google's dns server. As long as you're trying to connect to sites on the internet, this is fine.
As soon as you're trying to host sites on your local network you have to have a dns server that serves that purpose on your net, since Google doesn't know of your internal sites.
Oftentimes the router/gateway serves this purpose, so you can add the address there. Or you can edit the hosts file, as mentioned earlier.
Since your address is a dynamic dns address, I guess you're trying to make your Nextcloud accessible from the internet. Then you have to tell your router/gateway to pass requests to the address of the container. This is usually called a port forwarding.
But to be honest, if you're unfamiliar with all this stuff, you probably shouldn't open a port for a service inside your internal network. This has serious security implications.
 
That's Google's dns server. As long as you're trying to connect to sites on the internet, this is fine.
As soon as you're trying to host sites on your local network you have to have a dns server that serves that purpose on your net, since Google doesn't know of your internal sites.
Oftentimes the router/gateway serves this purpose, so you can add the address there. Or you can edit the hosts file, as mentioned earlier.
Since your address is a dynamic dns address, I guess you're trying to make your Nextcloud accessible from the internet. Then you have to tell your router/gateway to pass requests to the address of the container. This is usually called a port forwarding.
But to be honest, if you're unfamiliar with all this stuff, you probably shouldn't open a port for a service inside your internal network. This has serious security implications.
I've configured the port forwarding on my router by allowing ports 80 and 443 to route the the ubuntu cointainer ipaddress
 
Okay, so as soon as your ddns provider knows your ip address a dns resolver should be able to route the requests to your gateway which then hands it over to the CT.
 
I've been able to resolve the issue. The problem was fixed when i changed the address from https to http.
I will complete the rest of the nextcloud so that I can enable letsencrypt so that access is via https.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!