-

Note: You are currently viewing documentation for Moodle 3.10. Up-to-date documentation for the latest stable version of Moodle may be available here: Home servers and the internet.

Home servers and the internet: Difference between revisions

From MoodleDocs
(Needs more work but why not?)
 
(hoqw the internet work by TimH :))
Line 11: Line 11:
One basic problem is that many home computer's have their IP address assigned by their network provider and these will be intentionally changed/reassigned every few days.  Further, the IP address you see on your computer is not what other computers see when they communicate.
One basic problem is that many home computer's have their IP address assigned by their network provider and these will be intentionally changed/reassigned every few days.  Further, the IP address you see on your computer is not what other computers see when they communicate.


To be continued
==How the internet works 101==
Every computer on the internet has a unique IP address, which is a string of 4 numbers. For example, this server is 74.52.44.50. To get data from moodle.org, your computer needs to connect to that address. Similarly, your computer will have an IP address, which the server will use to send the data you ask for back to you.
 
Now typing numbers all the time is a pain in the neck, which is why we have the domain name system (DNS). That is simply a lookup service, so you can ask for http://moodle.org/ instead of having to remember things like http://74.52.44.50/.
 
Now as well as every computer having a real address like 74.52.44.50, the IP address standard defines some magic addresses, of which 127.0.0.1 is the most useful. No matter which computer you are on, 127.0.0.1 means 'this computer'. And in the DNS system, localhost is always an alias for 127.0.0.1.
 
So, if you are accessing your Moodle site with a URL like http://localhost/moodle/, it will only ever work on your own computer. However, if you can work out the real address of your computer, and change http://123.234.345.456/moodle/ (and if you update wwwroot in config.php), then other people will be able to access your Moodle.
 
Now, the oversimplification in the above is the bit 'Every computer on the internet has a unique* IP address'. Actually, it is more complicated than that. For example, if you have a home network with several computers behind a router, then actually, to the rest of the internet, it will appear as if there is just one computer (the router) attached to the internet. The router does some magic (also called Network Address Translation - NAT) to make all your computers seem like one. That is because there are only 255*255*255*255 ~ 4 billion IP addresses, and there are more computers than that in the world. That is also why we are moving (very slowly) from IP4 to IP6, which allows more addresses.
 
If you are behind a NAT router, then getting a real address for your computer is harder. Also, if you are behind a filewall, people may not be able to get to your Moodle, even if they know the address.


==There are exceptions==
==There are exceptions==

Revision as of 10:04, 7 July 2009

For most people, it is not possible to effectively connect a Moodle site installed on a home machine with the internet. IT professionals will say that a home computer can not support many people trying to use a Moodle site. Secondly, most home machines do not have IPs that other computers on the internet can find.

Capacity of a home server or small office intranet

Capacity includes bandwidth and memory.


MACs, IPs, routers, DHCP, and the internet

A webserver basically listens for a computer saying "I am looking for MoodleServer.org" or "I am looking for 192.168.0.42". When the web server hears that and knows it is MoodleServer.org or is 192.168.0.42, then the web server answers and the webserver shows a page or whatever to the seeker.

One basic problem is that many home computer's have their IP address assigned by their network provider and these will be intentionally changed/reassigned every few days. Further, the IP address you see on your computer is not what other computers see when they communicate.

How the internet works 101

Every computer on the internet has a unique IP address, which is a string of 4 numbers. For example, this server is 74.52.44.50. To get data from moodle.org, your computer needs to connect to that address. Similarly, your computer will have an IP address, which the server will use to send the data you ask for back to you.

Now typing numbers all the time is a pain in the neck, which is why we have the domain name system (DNS). That is simply a lookup service, so you can ask for http://moodle.org/ instead of having to remember things like http://74.52.44.50/.

Now as well as every computer having a real address like 74.52.44.50, the IP address standard defines some magic addresses, of which 127.0.0.1 is the most useful. No matter which computer you are on, 127.0.0.1 means 'this computer'. And in the DNS system, localhost is always an alias for 127.0.0.1.

So, if you are accessing your Moodle site with a URL like http://localhost/moodle/, it will only ever work on your own computer. However, if you can work out the real address of your computer, and change http://123.234.345.456/moodle/ (and if you update wwwroot in config.php), then other people will be able to access your Moodle.

Now, the oversimplification in the above is the bit 'Every computer on the internet has a unique* IP address'. Actually, it is more complicated than that. For example, if you have a home network with several computers behind a router, then actually, to the rest of the internet, it will appear as if there is just one computer (the router) attached to the internet. The router does some magic (also called Network Address Translation - NAT) to make all your computers seem like one. That is because there are only 255*255*255*255 ~ 4 billion IP addresses, and there are more computers than that in the world. That is also why we are moving (very slowly) from IP4 to IP6, which allows more addresses.

If you are behind a NAT router, then getting a real address for your computer is harder. Also, if you are behind a filewall, people may not be able to get to your Moodle, even if they know the address.

There are exceptions

There are places where you basically can rent a public ip for you computer. When your local friendly internet provider changes your IP, you log into one of these places, identify your self and the service will now recognize that your IP is not 192.168.0.42 but has changed to 192.168.40.14. However, more importantly all the computers in the world that know your computer as 127.127.127.127, will be able to find you.

There is an international body that essentially registers IP addresses. It might be possible to get them to issue you an IP address.

To be continued

See also