How to set up web server - the tutorial doesnt seem to work

Using TS-364

I have followed an online video on how to set up a webserver - basically I get as far as enabling the Web Server in the QTS-364 control panel. I can then see the ‘Web’ folder created and have put a basic ‘index.htm’ file in it.
However, when I click the links shown on the Control Panel Web Server page e.g. “https://xxxx.myqnapcloud.com/” it takes me to the desktop not the web page - what am I doing wrong ?

Any help (in simple steps) very much appreciated !

Thanks

Richard

You are currently exposing you QTS interface to everyone on the internet (VERY dangerous!)

What is the plan here ?

I just want to host a basic web site from my qnas- but instead of the device showing the website the link it provides goes to the desktop (as you say potentially exposing the device to the internet- it does still ask for login details if from an untrusted device)

Best to do that on a hosting service, you do not want the whole world accessing your NAS.

If you really really have to, install a container with httpd or something, much more secure than the bare metal installed webserver

At this point I am just trying to learn how things work - it is more for my personal interest than anything else. According to the tutorials setting up a simple website on a QNAP NAS should be really easy but I cant get it to work. Ive very much fallen at the first hurdle.

I understand, but even ‘just trying’ is exposing your NAS. Just look into a container (install container station > add application) and add a simple httpd via container.

Additionally go to your router and make sure upnp is disabled and any and all manual port forwards

Ill have a go with a container tomorrow - thanks - but I suspect I have a more fundamental issue to solve - see below…

I have just been enabling/disabling upnp in the router and QNAS without any effect - I have found out that when I run the port forwarding test on the QNAS it all fails.

I have also noticed that the WAN ip address on the QNAS / listed on myQNAPcloud is different to the WAN IP address(s) on my router

(so I have 4 different IP addresses -
WAN IP on the Router 100.99.xxx.xxx )*
Router IP 100.99.zzz.zzz )*
QNAS WAN IP / myQNAPcloud 149.22.xxx.xxx
QNAS internal network IP 168.192.4.200 - set via DHCP

  • Dont understand the difference - my last router only had 1 WAN IP

That doesn’t look right. Can you please confirm these numbers? :nerd_face:

A couple of weeks ago I deployed a simple httpd via container station, so I can post my YAML here (it’s using a virtual MAC address so your router DHCP would reassign the same IP on each build or reboot)

version: '3.9'
services:
  apache:
    image: httpd:latest
    container_name: my-apache-app
  network_mode: bridge
	mac_address: "02:42:ac:11:00:02"
    ports:
    - '9040:80'
    volumes:
    - /share/Foldername/subfolder:/usr/local/apache2/htdocs

Make sure

  • /share/Foldername/subfolder

actually exists (you can check that via SSH)

Sorry - my mistake

QNAS internal network IP 192.168.4.200 - set via DHCP

Also if I can’t even get a simple web page accessibility through the built in web server app doing anything more complicated is going to make finding the problem worse.

At the moment a port scanner shows port 80 is not being forwarded to the qnas ( or more likely the qnas is not responding as there is limited scope for error in my eero router port forwarding setup)

Until I can solve this issue I don’t see the point in trying more complex (if more secure) solutions

…… or am I wrong ?

Wrong approach, before you expose anything to WAN, you want to have it secure.

Have you tried the container approach ?

1 Like

I have container station already installed for backups (hyper data protector) but don’t understand your first step ‘ add a simple httpd via container. ‘ - I don’t understand what this means !

You add a httpd container with my above posted YAML

here are the slides of a recent webinar QNAP did around creating containers via compose YAML

Really appreciate you trying to help but you are talking another language that I simply don’t understand.

You should be able to turn on the webserver in the settings control panel and put your web documents there. Then from your LAN go to port 80 of the NAS IP address.

Disable UPNP - don’t use it ever.

If your goal is to use the webserver from your LAN only, whatever use the QNAP webserver. If you want to reach it from WAN (anywhere on the internet), you need to do a few clicks, paste that YAML (with changes made to a web storage folder of your choice) into that application field (see the slideshow)

1 Like

Ive found the problem - my ISP uses CGNAT so i dont have a public IP address and no device on the internet can initiate a connection to my home network because network address translation is not possible. Hosting a web server is therefore impossible for me :frowning:

Thanks for the suggestions though - I have learned a lot in the last 36 hours !

That is actually great news … many many people^ have been hacked via exposed NAS and had to pay a LOT (we are talking millions) in ransom … so CGNAT is your hero here.

^These people had excuses like:

  • I only shared my NAS with friends and family, how could this happen?
  • I am a just and person with no money, why would they come after me?
  • I only exposed my NAS quickly to test … but forgot about it