Justin Merrill

Engineer | Cloud | DevSecOps | SRE | K8s | GitOps | IaC | Data | APIs | BS | MBA

ComputersNetworkingWeb DevelopmentWeb Hosting

Is there a simple way to host a web site or file server from my home or office?

There are many flavors of Windows since Windows Server 2000 – 2012, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc., and now Windows 8.1 and Windows 8 Pro. Not all of these version of Windows have the Microsoft web server known as Internet Information Services (IIS) – formerly called Internet Information Server. I don’t believe ANY version of Windows installs IIS by default, so you will need to go to Add/Remove Programs in the Control Panel, and “Turn Windows Features on or off”, and turn it on. The Starter and Home versions of Windows may not have IIS available at all. For this reason, I recommend using Apache 2.2+ for Windows, it’s ALWAYS free (Open Source). I will assume you are running a non-server version of some sort of Windows throughout this article.

You can install Apache on any type of operating system, and there is a wealth knowledge available for various issues, configurations, and add-ons available online. Apache is also “open source”, which means it is TOTALLY free to use. If you are seeking to get more involved with developing content for the internet in a corporate business environment, you will probably want to get involved with using IIS for Windows, but getting started with IIS is somewhat more difficult (in the authors opinion) because you need to have a more detailed understand of things like DNS, Security, opening ports, and other internet specific details. The Apache Web Server packages can be found at http://httpd.apache.org/download.cgi and I recommend downloading the “Latest Stable Version”. Since I assume you are using Windows, and that you have never compiled your own software before, get the Win32 MSI package. Even if you have a 64-bit version of Windows, you can still run Win32 (32-bit) applications. There are other versions of Apache that come “bundled” with modules like Perl, PHP, MySQL, and FTP servers, so you may want to consider doing some research on WAMP, LAMP, and XAMPP, but for this tutorial, I plan to keep it super simple with the vanilla version of Apache web server.

So what you are trying to do with your web site? Do you want a web server that hosts a website? Do you just want a file server so you can share or access your files on the web? Most people want to buy a domain name and build a website according to their ideas. Having a web server in-house gives you FAR more flexibility in creating content that you publish online, and control over the users (web site visitors) interactivity, but the downside is that it takes a lot of responsibility too. You have to pay for the internet connect to your home or business, you need to keep the power supplied at all times, virus scans, installation configurations, tracking statistics (web visitors per day/month/year), and a long list of other things too. Once you get a feel for serving content on the web, I suggest you find a cheap web host that will take care of all that stuff for you. If you need help finding the right web server package for you, drop me an email by clicking on my profile. I currently pay about $100 a year for hosting an unlimited number of domains via unlimited storage and bandwidth, and TONS of extras and features, most of which I can actually use. But for this tutorial, I am going to show you how to do it in-house so you can decide what is best for you.

If you just want to play around with a web or file server (HTTP), you don’t even need a domain name at all. You can simply just install a Web Server software package on your computer and access it by typing the IP Address into any web browser like so:

http://65.34.81.253

When you begin hosting web files on your machine through Apache, the url with look like this:

http://65.34.81.253/web-page-name.html

Pretty cool, right?

But what if you don’t have a Static IP Address? What if it changes every time a storm comes through and knocks the power out for a few seconds? What if you are away from the office, and the IP changes without you knowing about it? How do you access the file server then? This is one of the two major reasons there is a need for a Domain Name Server (DNS).

A Domain Name Server (often called a DNS Server.. Redundant? Yes, but it’s not a perfect world.) basically recreates a way to connect a domain name like experts-exchange.com to an IP Address. Experts-exchange.com is hosted on a web server with the IP Address of 64.156.132.140 – try putting http://64.156.132.140 into a new web browser window or tab and see what happens. Impressed yet? Keep reading.

You can buy your own domain name(s), but… You don’t NEED to buy a domain name, you can get a free sub-domain name from dozens of places on the internet, but my personal favorite is from DynDNS.org because of the shortness of its domain name, and the awesome DNS tools. You will want to use a Dynamic IP Update software ( a good one for Windows: http://www.directupdate.net ) on your PC along with a free sub-domain from DynDNS.org or similar service so that if your IP changes, you can just type in http://my_free_sub_domain.dyndns_or_similar.org into your web browser and it will point right to your IP Address.

What if you want to buy your own domain name? That’s cool. Spend your money noob. But you have to pay for the domain name on an annual basis, and don’t go crazy with buying a bunch of domain names. Each and every domain name is quite a project. You need to think about what you are going to have to do in order to maintain them all. When you purchase your first domain name, I recommend using dyndns.com or sitelutions.com because of the DNS tools they provide. You have to have at least 2 Name Servers for each domain name. This is the second key reason why DNS is important. You can host multiple domain names (web sites) on the same server if you use DNS. If you have a Static IP Address, you can put it as one of your Name Servers, and use the Name Servers your chosen DNS Service provides. They will look something like: ns1.mydyndns.com || ns2.mydyndns.com or maybe dns1.sitelutions.com || dns2.sitelutions.com

Nowadays it usually takes about an hour for DNS to “propagate” to the major backbone servers of the internet around the world, but it could take up to 24 hours in some cases. Until this happens, you won’t be able to use your domain name (in most cases) until its completed.

You need to “Port Forward” if you are using a router in your home or office. All web browsers assume that Port 80 is the correct port the hosting web server is using, but it is possible to use a non-standard port. To use a non-standard port like port 81, type in www.your-domain-name.com:81 into your web browser. This can be a handy way to add a little security to your site if you have areas you don’t want accessed by the general public. Some routers do not support a function known as “loopback”, which allows you to view your own servers web pages through an internet browser from behind your own network. If this is the case, you will need to use the internal IP address of the computer you are using as your server in place of the domain name (i.e. instead of http://www.your-domain-name.com/web-page.html you will use http://192.168.1.3/web-page.html).

There is EXTENSIVE documentation available for getting your Apache web server up and running on your network, so I won’t go into that here. This is just a basic tutorial on how to get started. Apache web server uses configuration files that you need to edit to match your needs, but it’s not really all that tough to run a single web site. It gets a bit more tricky when you want to run multiple web sites, but I recommend starting out simple and working your way up.

I hope this helps, if you have any questions about the process, please let me know! I’ll be glad to help you get started!

Leave a Reply

Your email address will not be published. Required fields are marked *