Post by waybackman on Apr 11, 2010 23:55:51 GMT -5
In order to serve any type of internet service from home, including RunBasic web pages, you need to do several things. It helps if you know why these things need to be done.
The internet only has a limited number of IP addresses. If every computer connected to the internet required a unique IP address, the internet would have run out of available IP addresses a long time ago.
By default (unless you change it), when you turn your computer on, it automatically contacts your router and asks it for an IP address. The router has a "pool" of private IP addresses and it assigns or "leases" one of them to your computer, usually for a period of 24 hours.
When you request a web page (for example), your router forwards the request to the internet using the IP address which was assigned to you by your Internet Service Provider (ISP). The private addresses assigned by the router are never used on the Internet, so the router needs to "pretend" that the request is coming from the IP address assigned by your ISP while it's actually coming from the private IP address the router assigned to your computer.
The router keeps a record of which private IP address the request came from. When the reply comes back with the information, the router then automatically forwards the data packets to the private IP address the request came from.
This scheme makes things simple for Joe Average who just wants to browse web pages and send the occasional email, since the router takes care of all the difficult details of assigning IP addresses and forwarding data packets to the correct place.
This scheme doesn't work so well for Jack Poweruser who wants to serve a web page or other internet content.
Firstly, by default the router ignores any data packets directed to it from the internet which don't match a request from any of the private IP addresses. The router acts as a "firewall", preventing access to your computer unless your computer first asked for the information.
In order to run any type of service on the internet, you need to be able to receive unsolicited requests from other internet users. To allow this, you need to configure your router to permit these incoming requests.
It would be foolish and dangerous to your computer to just allow any and all requests to get through. Fortunately, you usually know what type of request you want to allow. Web page requests, for example, are almost invariably served using TCP (Transmission Control Protocol) on port 80 (I'm leaving out complicated stuff like SSL because we don't need to know about it for this discussion).
The router also needs to know where to send these unsolicited data packets. Sending them to all of the computers on your LAN would be possible, but wasteful of your LAN bandwidth. It's far more efficient to send them directly to the computer which is running the server application (such as RunBasic).
But now we come to the problem that the "lease" your computer obtained for its IP address will expire in 24 hours. After that point, the computer will, to all appearances, "vanish" from your network, leaving your web server unable to receive any requests.
The solution is to assign your computer a "fixed" IP address which never changes. That way, there is no lease to expire and the computer remains "connected" to the router and through it, to the Internet.
The fixed IP address usually needs to be in a similar form to the automatically assigned DHCP address. For example, if your computer's DHCP-assigned address is 192.168.1.100, then the fixed address you use needs to be somewhere in the range 192.168.1.3 to 192.168.1.253 (I've excluded 0, 1, 2, 254 & 255 because those numbers often have special uses depending on your router so it's best to avoid them).
The question then becomes, what fixed address do you give to your computer? If you give it address 192.168.1.100 and then connect another computer to your LAN, the router's DHCP server may try to assign 192.168.1.100 to the newly connected computer. Two computers on the same network with the same IP address is A Bad Thing. (It would be almost like giving two telephones in the same town the same telephone number).
The answer is that you may have two options. One is to find what range of addresses your router is using for DHCP and assign your fixed IP address outside that range (if your router starts its DHCP addressing at 100, you are almost certainly going to be okay assigning an address in the range 3-99, for example). The other option is that some routers allow you to deliberately reserve a particular IP address for a particular computer (using what is known as the MAC address which will be unique to every computer) and the router will then "know" that IP address is not available and will never try to assign it to another computer using DHCP.
Once you have your router configured correctly so that your server computer will have a static IP address, you should then configure that IP address within your computer. Different Operating Systems have different methods for accessing this information. In Windows XP, you open Control Panel, open Network Connections, right-click on your Local Area Connection and select Properties, Select Internet Protocol (TCP/IP) and click Properties.
Job done? Almost. Now we know where to forward the requests to, we need to tell the router to do it.
Configuring the router is different depending on the brand and model. On some routers, you use something called "virtual servers" to open up the link. On others, you need to use "port forwarding". If you have a Virtual Servers option, use it in preference to Port Forwarding.
You need to tell the router what port to forward (80 is the standard port for web pages), what protocol to allow (TCP is for web pages) and where to forward the requests to. Enter the fixed IP address of the computer where you're running your web server.
Save it all, start RunBasic and you should have a running web server, accessible from the internet using your ISP-assigned IP address.
But what if the IP address assigned by your ISP isn't static? Many ISPs still use dynamic addresses with a "lease" assigned by a similar scheme which your router uses for its DHCP server. When the lease runs out, the ISP assigns you a new IP address from their "pool" of IP addresses.
This is where services such as no-ip.com come in. They allow you to assign a domain name to your IP address and you run a client program on your server computer which keeps track of whether or not your IP address has changed. If the address does change, no-ip.com is contacted by the client program so that the IP address linked to the domain name can be updated almost immediately.
Instead of people trying to contact your web server by your IP address, which may change without notice, users contact the site by the domain name which no-ip.com keeps updated to always point to your IP address, even when it changes.
Your ISP blocks incoming requests on port 80? no-ip.com also allows for "port translation" so that your users can request data using the default port (80) but by the time the request reaches you, no-ip.com has "translated" it to a different port such as 8008 which isn't being blocked (but check your ISP's terms of service as they may cut you off without warning if they don't allow you to serve web pages from home and they discover you are doing so).
(I am not associated with no-ip.com and don't receive any payment from them. I'm only mentioning them because they are the service I use and I'm satisfied with the service I get from them. There are other similar services on the internet and you may be better served by one of them, depending on your location and circumstances).
There you have it. That's how to configure your computer and router to allow you to serve web pages from home.
I've deliberately avoided giving exact, step-by-step details of how to do most of the things described here, because there are so many different router makes and models on the market as well as different computer Operating Systems and each has its own method of accessing their internet configuration.
I hope this information is useful to people trying to configure a computer to serve RunBasic web pages.
The internet only has a limited number of IP addresses. If every computer connected to the internet required a unique IP address, the internet would have run out of available IP addresses a long time ago.
By default (unless you change it), when you turn your computer on, it automatically contacts your router and asks it for an IP address. The router has a "pool" of private IP addresses and it assigns or "leases" one of them to your computer, usually for a period of 24 hours.
When you request a web page (for example), your router forwards the request to the internet using the IP address which was assigned to you by your Internet Service Provider (ISP). The private addresses assigned by the router are never used on the Internet, so the router needs to "pretend" that the request is coming from the IP address assigned by your ISP while it's actually coming from the private IP address the router assigned to your computer.
The router keeps a record of which private IP address the request came from. When the reply comes back with the information, the router then automatically forwards the data packets to the private IP address the request came from.
This scheme makes things simple for Joe Average who just wants to browse web pages and send the occasional email, since the router takes care of all the difficult details of assigning IP addresses and forwarding data packets to the correct place.
This scheme doesn't work so well for Jack Poweruser who wants to serve a web page or other internet content.
Firstly, by default the router ignores any data packets directed to it from the internet which don't match a request from any of the private IP addresses. The router acts as a "firewall", preventing access to your computer unless your computer first asked for the information.
In order to run any type of service on the internet, you need to be able to receive unsolicited requests from other internet users. To allow this, you need to configure your router to permit these incoming requests.
It would be foolish and dangerous to your computer to just allow any and all requests to get through. Fortunately, you usually know what type of request you want to allow. Web page requests, for example, are almost invariably served using TCP (Transmission Control Protocol) on port 80 (I'm leaving out complicated stuff like SSL because we don't need to know about it for this discussion).
The router also needs to know where to send these unsolicited data packets. Sending them to all of the computers on your LAN would be possible, but wasteful of your LAN bandwidth. It's far more efficient to send them directly to the computer which is running the server application (such as RunBasic).
But now we come to the problem that the "lease" your computer obtained for its IP address will expire in 24 hours. After that point, the computer will, to all appearances, "vanish" from your network, leaving your web server unable to receive any requests.
The solution is to assign your computer a "fixed" IP address which never changes. That way, there is no lease to expire and the computer remains "connected" to the router and through it, to the Internet.
The fixed IP address usually needs to be in a similar form to the automatically assigned DHCP address. For example, if your computer's DHCP-assigned address is 192.168.1.100, then the fixed address you use needs to be somewhere in the range 192.168.1.3 to 192.168.1.253 (I've excluded 0, 1, 2, 254 & 255 because those numbers often have special uses depending on your router so it's best to avoid them).
The question then becomes, what fixed address do you give to your computer? If you give it address 192.168.1.100 and then connect another computer to your LAN, the router's DHCP server may try to assign 192.168.1.100 to the newly connected computer. Two computers on the same network with the same IP address is A Bad Thing. (It would be almost like giving two telephones in the same town the same telephone number).
The answer is that you may have two options. One is to find what range of addresses your router is using for DHCP and assign your fixed IP address outside that range (if your router starts its DHCP addressing at 100, you are almost certainly going to be okay assigning an address in the range 3-99, for example). The other option is that some routers allow you to deliberately reserve a particular IP address for a particular computer (using what is known as the MAC address which will be unique to every computer) and the router will then "know" that IP address is not available and will never try to assign it to another computer using DHCP.
Once you have your router configured correctly so that your server computer will have a static IP address, you should then configure that IP address within your computer. Different Operating Systems have different methods for accessing this information. In Windows XP, you open Control Panel, open Network Connections, right-click on your Local Area Connection and select Properties, Select Internet Protocol (TCP/IP) and click Properties.
Job done? Almost. Now we know where to forward the requests to, we need to tell the router to do it.
Configuring the router is different depending on the brand and model. On some routers, you use something called "virtual servers" to open up the link. On others, you need to use "port forwarding". If you have a Virtual Servers option, use it in preference to Port Forwarding.
You need to tell the router what port to forward (80 is the standard port for web pages), what protocol to allow (TCP is for web pages) and where to forward the requests to. Enter the fixed IP address of the computer where you're running your web server.
Save it all, start RunBasic and you should have a running web server, accessible from the internet using your ISP-assigned IP address.
But what if the IP address assigned by your ISP isn't static? Many ISPs still use dynamic addresses with a "lease" assigned by a similar scheme which your router uses for its DHCP server. When the lease runs out, the ISP assigns you a new IP address from their "pool" of IP addresses.
This is where services such as no-ip.com come in. They allow you to assign a domain name to your IP address and you run a client program on your server computer which keeps track of whether or not your IP address has changed. If the address does change, no-ip.com is contacted by the client program so that the IP address linked to the domain name can be updated almost immediately.
Instead of people trying to contact your web server by your IP address, which may change without notice, users contact the site by the domain name which no-ip.com keeps updated to always point to your IP address, even when it changes.
Your ISP blocks incoming requests on port 80? no-ip.com also allows for "port translation" so that your users can request data using the default port (80) but by the time the request reaches you, no-ip.com has "translated" it to a different port such as 8008 which isn't being blocked (but check your ISP's terms of service as they may cut you off without warning if they don't allow you to serve web pages from home and they discover you are doing so).
(I am not associated with no-ip.com and don't receive any payment from them. I'm only mentioning them because they are the service I use and I'm satisfied with the service I get from them. There are other similar services on the internet and you may be better served by one of them, depending on your location and circumstances).
There you have it. That's how to configure your computer and router to allow you to serve web pages from home.
I've deliberately avoided giving exact, step-by-step details of how to do most of the things described here, because there are so many different router makes and models on the market as well as different computer Operating Systems and each has its own method of accessing their internet configuration.
I hope this information is useful to people trying to configure a computer to serve RunBasic web pages.