14
votes

I want to run a web server from home, so my family, and clients can see what I am doing. It would not run a large load, at most 2 or 3 users at a time.

I would like to know how to do it with a Windows machine running IIS.

I have a router from my cable company and it runs through a wireless router to the machine I would want to be a web server.

3
  • Correct me if I'm wrong, but are you saying that the connection between the server and your cable modem is a wireless connection? I ask only because I would strongly recommend against it...
    – AnonJr
    Apr 30, 2009 at 20:40
  • 1
    Why recommend against a wireless LAN connection between the router and the IIS server? Bandwidth shouldn't be an issue since any wireless LANs bandwidth (a/b/g/n) is going to dwarf that of the internet pipe. Other than security issues that are endemic to all wireless networks, why specifically should you not do it for an IIS server? Apr 30, 2009 at 21:01
  • No my computer is hard wired, I should of said a router that does wireless, laptop, xbox, and main PC wired. May 1, 2009 at 14:41

7 Answers 7

17
votes

Here are the basic steps. The specific details depend on what kind of router you have, but the concepts still apply:

  1. Install IIS on the machine you want to be a web server. It is okay to leave it on the standard port 80 in most cases (we'll remap the port later through the firewall since most ISPs disallow incoming traffic on port 80).

  2. Go to DynDns.org and create yourself a name which maps to your home IP address. This is important because your address will change from time to time (the "D" in DHCP) and you want to have a well-known external name to your home. Using DynDNS is pretty easy and they have good FAQs to help you. If your router supports DynDns automatically, then you will need to log onto your router and supply the dyndns.org username and password. If your router does not support DynDNS, they have a small utility that you should download and install on your IIS machine that runs all the time and detects when your public IP address changes and updates your dyndns host record.

  3. Logon to your router (typically a website located at 192.168.0.1, or whatever the first IP address of your IP range is). Set a fixed IP address for your IIS machine. Typically this is accomplished by assigning a fixed DHCP address to the MAC address of your IIS machine. Once you do that, your IIS machine will always fetch the same IP address when it requests one via DHCP

  4. Logon to your router. Add a "port mapping" (or sometimes called a "static route"), mapping public TCP port 8080 incoming to the IP address of your local IIS computer on port 80 (the default port). Note that some routers don't allow you change ports (often time, that's the "static route" option). In that case, you're going to want to reconfigure IIS to listen on port 8080 (or whatever port you want to make public) and just create a route from public TCP port 8080 to port 8080 on your IIS computer.

Obviously, there are several places where this can be misconfigured and troubleshooting is inevitable.

  1. Verify that IIS is working on your local network. Fire up your favorite browser and navigate to the local IP address and port of your IIS computer: http://192.168.0.5:80, or whatever is appropriate. Make sure it works. If not, fix it until it does.

  2. Verify that your DynDNS record is correctly mapping to your current public IP address. You can figure out your current public IP address by going to http://whatismyipaddress.com. Once you know that, open a command prompt and ping your public name ("ping longhorn213.homeip.net" or whatever name DynDNS gave you) and see if it works. The ping itself may be blocked (many routers block incoming pings), but you should still see the IP address that was looked-up. Make sure it matched your actual public address. If not, work with DynDNS org to get this working.

  3. If troubleshooting steps 1 and 2 are both working, then the problem is likely to be in the port mapping of your router. That's the hardest to troubleshoot usually. Often times routers have internal logs that you can turn on. Look for incoming traffic logs for the designated port and see what the router is doing with it. You may need to find a forum or support site for your specific router to get this working if you have problems.

0
8
votes

Many ISPs won't allow incoming traffic on port 80, so you might have to run on a nonstandard port. In either case, you can configure your router to forward traffic on port 80 (or whatever you use) to your server computer. Your server will need a static IP address on your LAN (rather than a DHCP assigned address).

If your ISP provides you with a dynamic IP, you'll probably want to use Dynamic DNS. Many routers have DynDns support built in.

5
votes

You should be careful because in most cases, running a web server off of a residential internet connection is listed as a practice against the Terms of Service for many ISPs.

2
votes

You may or may not be able to easily set up a web server at home that is accessible by the internet. I know that my ISP specifically blocks port 80 inbound so that even if I allow the traffic myself it never gets to my router. Assuming that this is not an issue what I would do is register with dyndns.org or something similar so that you're able to get to your host regardless of IP changes due to DHCP from the cable company. After that I'd configure the box with IIS and then set up port forwarding to go from the router to the web server on port 80.

0
votes

While it is possible the usefulness is questionable. I have a WHS that runs a website for me to get remote access, runs just fine 24 x 7 x 365. However any actual website that I want to run I use a shared hosting provider.

Most of the time when you purchase a domain it will come with some free hosting. And unless you really want to concern yourself with doing System Administrator for a simple website running out of your house all the time, it is just not worth it.

0
votes

There are several NAS appliances around now that also have web servers built in. some just for thier own admin pages but other with a full LAMP install and an area specifically for adding things like blogs etc. then, if you don't have the ISP issues mentioned, set it up as static IP or reserve a DHCP entry, forward incoming port 80 (or whatever you choose) to the appliance and you're done.

the appliance will usually have a Dynamic DNS updater client built in too

0
votes

Note that IIS isn't your only option. Apache runs just fine on Windows, as does PHP, Perl, Python, and MySQL. If you're sufficiently tech savvy, Apache is a good option since it generally uses less resources than IIS (if you plan on using your system for other tasks at the same time).

Not the answer you're looking for? Browse other questions tagged .