This tutorial will go over the steps necessary to setup your own web server. I would recommend this procedure for anyone who would like to learn more about the Internet or web related technologies. Web hosting can be done either through a windows or Linux box. This article will go over setting up a web server using Internet information services on a windows machine.
The first step is to determine whether or not you will be using your existing Internet connection. If you have never setup a web server, in your home or business, then most likely you have either a dsl or cable modem with a dynamically assigned ip address and asymmetric Internet access. Neither of these is a hindrance to setting up a web server to host your own blog. If, however, over time, you find that you need more upstream bandwidth and/or static ip addresses it may be better at that point to shift to a dedicated hosing provider.
Next, you’ll need a dedicated web server. This could be an older computer that you are not using anymore, or a new machine that you prebuilt or purchased. Ideally, you should not be using this machine for anything else. Running other applications increases the likelihood that you may need to restart your machine, or that it will have some kind of software related failure. Your computer should also be running a stable Windows OS, XP or higher. You may need to factory restore your machine, if your OS has become unstable overtime, to prepare it to be used as a web server. Also, install any available security updates through the windows update website, and a reputable antivirus software program such as Microsoft Security Essentials or Kaspersky Internet Security.
Once you have broadband internet and the computer hardware available you can begin taking the necessary steps to setup your computer as a dedicated web server. The first step is to install Internet Information Services, which is not configured by default under a typical Windows install. This can be done by going to the control panel and selecting programs and features. Once here click on “turn windows features on or off” and navigate to and select Internet Information Services for installation.
After this feature is activated, your computer will be officially running server software. You can verify this by going to http://localhost in a browser window. You should see the default IIS page show up confirming that you are running Internet Information Services. The HTML pages that are being served by your computer are stored in the c drive in a folder called inetpub.
You can place your website’s files here or in a different directory if you prefer. If you choose to use a different directory you need to open up Internet Information Services, from the start menu, and change the default location for the files being served by your computer. This can be done from the left pane by right clicking on the default website, selecting manage website, and then advanced settings. From there simply change the physical path to correspond with the path of your HTML files. Click ok to apply the changes. Now, if you go to your browser, and navigate to http://localhost, you will see your website. Several steps remain so that it can be accessed from other locations.
Make sure that port 80 is not being blocked by your firewall. Exemptions need to be added either to windows firewall, or on your third party software, like the one included with Kaspersky Internet Services. The process varies, depending on the software you are using, so it is best to consult the vendor’s documentation on how to accomplish this.
It is also a good idea to assign a static ip address to your computer, if you are behind a router to access the Internet, which is the most common setup, since most people have more than one computer. A static ip address can be assigned by going to the start menu, navigating to the control panel, then from the control panel selecting “network connections”. On newer versions of windows you may need to open the “network and sharing center” before being able to access the option to manage network connections.
From within this view, right click on the active network connection and select properties. Then click on ipv4 and select properties. Here you can change the relevant settings for your PC. Select static ip address, instead of dynamically assigned. Make sure that your subnet and subnet mask are the same as that of your router. You can ensure that this is the case by opening a command window and running the ipconfig command simply by typing it in and hitting the return key. It will show you the subnet that you are on, and the ip address that was dynamically assigned to your computer. The subnet is normally 255.255.255.0 and the ip address assigned to your computer is usually, 192.168.x.x or similar.
Assign your PC an IP address outside the range which is dynamically assigned by your router. For example, if your router assigns ip addresses beginning at 192.168.1.100, assign your PC an IP address of 192.168.1.99 or lower, so long as it doesn’t have the same one as another device on your network. Also, assign the default gateway, it’s the same as your router’s IP address and should be available from the command window. You can also have your router reserve a particular address for your PC. Please consult vendor specific documentation for the steps to do this. Finally, click ok within the ipv4 properties dialog to apply the changes.
We still are not done yet. We need to change some of the port forwarding options on your router. Specifically, requests for port 80 need to be forwarded to your PC, so that the outside world may access your website. The steps for this vary by manufacturer, but include accessing your routers settings via a web browser by typing in http://192.168.x.x where the x’s correspond to your router’s ip address. The defaults are generally 192.168.0.1, 192.168.1.1, or 192.168.2.1, and are the same as the default gateway. The router will request a login. Default passwords, for routers, are generally either blank or admin. The same is the case for the username. Navigate to the port forwarding configuration page, normally accessible from the LAN section of the website, or similar. If you encounter any difficulties with the above steps consult the documentation provided with your router.
Once these steps are completed, your website will be accessible from anywhere using the IP address assigned to your router by your ISP, this is different from 192.168.x.x. It is the IP address seen by computers outside your network. If you don’t know your IP address, just go to www.whatismyipaddress.com to find out. 192.168.x.x works only within your home network. For example, if your IP address were 220.127.116.11, your website could be accessed from any browser by typing http://18.104.22.168. You will need to get a domain from a domain registrar, such as GoDaddy, and use a dns service, such as afraid.org, to translate this number to a web address. DynDNS also provides similar services, with a free subdomain, and most routers can be configured to automatically update these providers with their IP addresses, if they change.
A domain from GoDaddy costs less than $10 in most cases. You’ll need to set up an account with them and change the name servers for your domain to ns1.afraid.org, ns2.afraid.org, ns3.afraid.org, and ns4.afraid.org. You can do this within the manage my domain section of their website, and by choosing the set name servers options. Then go to afraid.org, and create an account with them. Click on domains, in the navigation pane, and select add a domain. Add the one that you just purchased, and configure your IP address for both www.yourdomain.com and yourdomain.com.