2

This is probably a simple question so forgive me...

I run a Synogy NAS that is accessible externally via port 5000. I also run a web server on another PC that is on port 80. I set up a Moodle server on the Synology that I would like to be visible to the outside world.

Right now, I can only do it internally via NAS/Moodle. I access this all via dyndns when remote. Is there a way to access Moodle remotely? I can't think of a way...

Thank you!

Anaksunaman
  • 18,227

2 Answers2

0

The answer is called "Port Forwarding". Your local network is likely behind a NAT device which would be your router\firewall. That device is the only one who accepts incoming packets from the internet. Because your local devices are not publicly routable the router wouldn't know which local device to send incoming packets to, unless you told it.

Log in to your border device (router\firewall) and look for port forward rules. You will need to forward the moodle ports in to the NAS in order to connect to it remotely. Moodle uses port 80. You mentioned that you are already running a web server. If that web service is already using port 80 then you need to change the port for either the web server or the moodle server.

You could run one on port 8080.

OR

You could set up a proxy, like NGNIX that would handle the incoming traffic. The way this looks is: Port 80 would be forwarded to the NGNIX server. Then you could have your main website on yourhostname.com and the moodle site on a subdomain like moodle.yourhostname.com. Then NGNIX could forward traffic based on the hostname to different backend webservers.

All that being said, it looks like you should just use a hosted solution like: https://new.moodle.net/

HackSlash
  • 5,015
0

If Moodle is running on another port (other than 80), then you should be able configure your router to access it similarly to your NAS on port 5000 (i.e. via port forwarding).

However, if Moodle is running on port 80 on the NAS (or you do not wish to have a port number visible when using Moodle on another port), then you will need to set up a reverse proxy on your network. In short, a reverse proxy listens for incoming e.g. HTTP requests and facilitates directing those requests to the proper server. It also assists in relaying responses back to the original client.

Creating a reverse proxy typically involves simply configuring a server on your network to handle this function. While it may be possible to do this via your NAS, you'll likely have a bit more control over the PC with just the web server. In that case, your communication chain would probably be:

<Internet> <---> <Router> <---> <Web Server [Reverse Proxy]> <---> <NAS>

Note that while your <Web Server> is your reverse proxy in the diagram above, it can still hand out websites configured on that server.

The actual steps to setting up a reverse proxy will vary with the device or software used. For instance, Apache uses certain modules and "virtual hosts" while Nginx uses (virtual) "server blocks" and your NAS may have its own way of being configured.

Regardless, as a general rule, you will want/need a second domain name (dynamic or otherwise) to access Moodle. This is often the easiest (or only) way to distinguish websites running on the same IP:port combination. This can potentially be a subdomain (i.e. http://subdomain.example.com).

Anaksunaman
  • 18,227