2008-08-18: You can host your own website at home, and I'll tell you exactly how! But it might not save you much money, and it definitely won't save you time. So give it serious thought before you proceed... unless your goal is simply to learn about the technology and have fun!
The best reason to host your website at home is to learn how it all works. For more information about the pros and cons, see should I host my own website?
Warning: running a server of any kind at home is a security risk. Security problems are sometimes found in server software, and these can be exploited to gain access to or damage your files. Your computer must be kept absolutely up to date with Windows Update or the equivalent for your operating system if you intend to run a web server on it. If you choose to run Apache instead of Internet Information Server, you'll need to keep your version of Apache absolutely up to date too. This doesn't eliminate the risk -- it only minimizes it. You run a server at home entirely at your own risk. If you do choose to run a server at home, I recommend finding an old PC on the curb and setting it up as your home server, reducing the danger to your own computer.
1. Make sure you have cable modem, DSL or another high-speed connection. A dialup telephone modem is NOT good enough.
2. Get a DNS hostname for your home Internet connection.
3. Get a static local IP address for your computer within your home network.
4. Configure your router to correctly forward connections on port 80 (the HTTP port) to your web server. Even if you think you don't have a router, you probably do— many popular cable and DSL modems include wifi or wired Ethernet jacks for multiple computers, which means they contain a built-in router. If your ISP blocks port 80, choose an alternative port number and forward that (or get a better ISP that welcomes websites at home, like Speakeasy.Net).
5. Configure Windows Firewall to allow your web server to communicate on port 80.
6. Get Apache, a free, high-quality web server program. If you have Windows XP Professional, you also have the option of Microsoft Internet Information Server (IIS), which comes standard with Windows XP Professional. But that option only allows you to host one site. I recommend Apache.
7. Test your web server from your own computer.
8. Replace the default home page with your own web page. Now the site is your own!
9. Test your web server from a computer that is NOT on your home network to make sure you followed all of the steps correctly.
And that's it! Now I'll present detailed information about each step.
Step One: Broadband
Get cable modem (from the cable company) or DSL (from the phone company and various other companies). If you can't do that, you'll have to host your website in some other way. Your computer must have a fast connection to grapple with video and audio files anyway. You don't necessarily have to go with your phone company's DSL offering. Check out broadbandreports.com for independent reviews of cable modem and DSL companies. Upload speed, not download speed, is the most important feature for hosting websites at home.
For more information, see my article how fast is my website?Step Two: Dynamic or Static DNS
Other people can't talk to your website if they don't know the address... and if you have a typical cable modem or DSL connection, your address changes often. You can solve this problem by using a dynamic DNS service. Even if your IP address doesn't change, you still need someone to host a DNS server for you, unless you are willing to put up with giving users a URL that begins with a string of numbers. This is a common requirement both for hosting websites at home and for hosting torrents, so I've written a separate article explaining how to get a hostname for your computer at home.
Step Three: A Static Local IP Address
If you have a router... and you do, if you have WiFi (wireless access) or more than one computer... then your computer receives a new local address on your home network, or Intranet, every time it is powered on. But to forward web browser connections to your computer, you need an unchanging address to forward those connections to. This is also a shared requirement both for hosting websites at home and for hosting torrents, so I've written a separate article explaining how to give your computer a static local IP address.
Step Four: Forwarding Port 80
If you don't have a router (and you know by now, if you have been following these steps...) then you can skip this step and move on to the next. If you have WiFi, or more than one computer, you definitely have a router and must not skip this step.
Now that you have chosen a static local IP for your computer, you're ready to configure the router to forward web traffic to your computer.
Again, this step is needed both for web hosting at home and for BitTorrent hosting. So, once again, there is a separate article explaining how to forward ports from the Internet to your computer via your router. Just follow the steps in that article to forward port 80.
Step Five: Allowing Web Traffic Through The Firewall
More firewall issues? Didn't we already do this? Only in part. Yes, your router serves as a firewall, but your computer also has a built-in firewall. You'll need to configure that firewall to allow traffic through on port 80 to reach your web server software. This step is also common to both web hosting and torrent hosting... so check out my article explaining how to allow traffic on specific ports through your computer's firewall.
Step Six: Get Apache Or Internet Information Server
If you have Windows XP Professional, you can also run Microsoft Internet Information Server. It comes free in the box... but only with XP Professional (and high-end server versions of Windows). If you have XP Home, or an older version of Windows, go with Apache - and consider upgrading to at least XP Home for better network performance.
I'll cover Apache first. Then I'll look at Internet Information Server, which is also excellent and is available if you have Windows XP Professional or a high-end server version of Windows. It will only host one site per computer on XP Professional, though.
Although Apache was born in the Unix/Linux world, it runs great on Windows too. In general, the newer your Windows, the easier it is to install Apache. Those with older versions of Windows, even Windows 95, can still run Apache but will have to jump through a few extra hoops. For complete information, check out the Apache Foundation's Microsoft Windows Apache installation tutorial. Since that article is a little old, you'll just have to bear in mind that instructions for Windows NT or 2000 also apply to Windows XP.
Microsoft has fixed problems in Windows XP that create issues for Apache. Use Windows Update to upgrade your Windows XP system to service pack 2. You have probably already done this. If not, you need to do it in any case to fix many important security problems that have nothing to do with Apache!
Not sure if you have service pack 2? Do this: click on "Start," right-click on "My Computer," select "Properties" and look at the information presented under "System." You should see "Service Pack 2." If not, visit Microsoft's Windows Update site, using Interet Explorer, not Firefox... just this once! The Windows Update site uses special Active X controls to update your computer. Normally I don't encourage the use of Active X, but for upgrading Microsoft's own operating system from Microsoft's own website using Microsoft's own browser, it's OK!
The best reason to host your website at home is to learn how it all works. For more information about the pros and cons, see should I host my own website?
Warning: running a server of any kind at home is a security risk. Security problems are sometimes found in server software, and these can be exploited to gain access to or damage your files. Your computer must be kept absolutely up to date with Windows Update or the equivalent for your operating system if you intend to run a web server on it. If you choose to run Apache instead of Internet Information Server, you'll need to keep your version of Apache absolutely up to date too. This doesn't eliminate the risk -- it only minimizes it. You run a server at home entirely at your own risk. If you do choose to run a server at home, I recommend finding an old PC on the curb and setting it up as your home server, reducing the danger to your own computer.
Procedures for other operating systems are similar, and most of these steps actually involve your router, so this article should still be helpful to non-Windows users.
Here are the steps to follow to set up a website hosted entirely on your own Windows PC. First I'll present the general steps, then I'll break down the details for you: 1. Make sure you have cable modem, DSL or another high-speed connection. A dialup telephone modem is NOT good enough.
2. Get a DNS hostname for your home Internet connection.
3. Get a static local IP address for your computer within your home network.
4. Configure your router to correctly forward connections on port 80 (the HTTP port) to your web server. Even if you think you don't have a router, you probably do— many popular cable and DSL modems include wifi or wired Ethernet jacks for multiple computers, which means they contain a built-in router. If your ISP blocks port 80, choose an alternative port number and forward that (or get a better ISP that welcomes websites at home, like Speakeasy.Net).
5. Configure Windows Firewall to allow your web server to communicate on port 80.
6. Get Apache, a free, high-quality web server program. If you have Windows XP Professional, you also have the option of Microsoft Internet Information Server (IIS), which comes standard with Windows XP Professional. But that option only allows you to host one site. I recommend Apache.
7. Test your web server from your own computer.
8. Replace the default home page with your own web page. Now the site is your own!
9. Test your web server from a computer that is NOT on your home network to make sure you followed all of the steps correctly.
"I followed all the steps and I get my router's login page instead of my home page!"
You are trying to access your website by name from behind your router (from one of your own PCs). With some consumer-grade routers, this does not work because the router automatically assumes any web connection to itself from inside your network is an attempt to log into the router's configuration interface. It's a pain, but this fail-safe mechanism does prevent you from locking yourself out of your router's web interface. So test from outside your own home network or have a friend do that for you. If you can access your home-hosted website from someone else's computer, then you don't have a problem. If you want to access your site from a computer behind your router, you'll have to access it at its static local IP address instead of by name.Step One: Broadband
Get cable modem (from the cable company) or DSL (from the phone company and various other companies). If you can't do that, you'll have to host your website in some other way. Your computer must have a fast connection to grapple with video and audio files anyway. You don't necessarily have to go with your phone company's DSL offering. Check out broadbandreports.com for independent reviews of cable modem and DSL companies. Upload speed, not download speed, is the most important feature for hosting websites at home.
"How fast will my home-based website be?"
The main limitation will be your upload speed (uplink speed). Most DSL or cable modem connections have an upload speed between 128kbps (128,000 bits per second) and 384kbps (384,000 bits per second). So how long does it take to load your home page? Add up the size of your home page (in bytes), the sizes of all of the images on that page, and the size of any Flash movies (.swf files) or CSS style sheets (.css files) referenced by that page. Now multiply by 8 and you'll know how many bits make up your home page. Divide that by your upload speed and you'll have a rough idea how long it takes to load your home page under ideal conditions. There will also be latency delays slowing things down, and multiple users will of course slow things down and make it take longer. There is no fixed limit on the number of users who can access your home-based website at the same time - things just slow down.For more information, see my article how fast is my website?
Other people can't talk to your website if they don't know the address... and if you have a typical cable modem or DSL connection, your address changes often. You can solve this problem by using a dynamic DNS service. Even if your IP address doesn't change, you still need someone to host a DNS server for you, unless you are willing to put up with giving users a URL that begins with a string of numbers. This is a common requirement both for hosting websites at home and for hosting torrents, so I've written a separate article explaining how to get a hostname for your computer at home.
Step Three: A Static Local IP Address
If you have a router... and you do, if you have WiFi (wireless access) or more than one computer... then your computer receives a new local address on your home network, or Intranet, every time it is powered on. But to forward web browser connections to your computer, you need an unchanging address to forward those connections to. This is also a shared requirement both for hosting websites at home and for hosting torrents, so I've written a separate article explaining how to give your computer a static local IP address.
Step Four: Forwarding Port 80
If you don't have a router (and you know by now, if you have been following these steps...) then you can skip this step and move on to the next. If you have WiFi, or more than one computer, you definitely have a router and must not skip this step.
Now that you have chosen a static local IP for your computer, you're ready to configure the router to forward web traffic to your computer.
Again, this step is needed both for web hosting at home and for BitTorrent hosting. So, once again, there is a separate article explaining how to forward ports from the Internet to your computer via your router. Just follow the steps in that article to forward port 80.
Step Five: Allowing Web Traffic Through The Firewall
More firewall issues? Didn't we already do this? Only in part. Yes, your router serves as a firewall, but your computer also has a built-in firewall. You'll need to configure that firewall to allow traffic through on port 80 to reach your web server software. This step is also common to both web hosting and torrent hosting... so check out my article explaining how to allow traffic on specific ports through your computer's firewall.
Step Six: Get Apache Or Internet Information Server
Mac and Linux users: you already have Apache! MacOS X users should read Kevin Hemenway's great article on onlamp.com. Linux users: install the Apache packages and look in /var/www/html or a similar location for your website folder.
Apache is the most popular web server in the world, with nearly 70% of all websites running Apache as of January 2006, according to the netcraft web server survey. Why is it so popular? Because it's free, open-source, high-quality software. And you can run it on your Windows box at home! If you have Windows XP Professional, you can also run Microsoft Internet Information Server. It comes free in the box... but only with XP Professional (and high-end server versions of Windows). If you have XP Home, or an older version of Windows, go with Apache - and consider upgrading to at least XP Home for better network performance.
I'll cover Apache first. Then I'll look at Internet Information Server, which is also excellent and is available if you have Windows XP Professional or a high-end server version of Windows. It will only host one site per computer on XP Professional, though.
Windows 98 and Me users can use Microsoft's "Personal Web Server." However, this software went away with the release of XP Home, and it's not a popular choice. Since you can run Apache for free - the world's most popular web server, for businesses and individuals alike - I don't recommend suffering with PWS.
Apache Quick-Start Guide Although Apache was born in the Unix/Linux world, it runs great on Windows too. In general, the newer your Windows, the easier it is to install Apache. Those with older versions of Windows, even Windows 95, can still run Apache but will have to jump through a few extra hoops. For complete information, check out the Apache Foundation's Microsoft Windows Apache installation tutorial. Since that article is a little old, you'll just have to bear in mind that instructions for Windows NT or 2000 also apply to Windows XP.
The following quick-start guide applies to Windows XP, but users of older versions of Windows can run Apache too... if they follow the extra steps spelled out in the Apache Foundation's Using Apache with Microsoft Windows tutorial to prepare their older computers to handle modern software installation and networking.
Upgrading to Windows XP Service Pack 2 Microsoft has fixed problems in Windows XP that create issues for Apache. Use Windows Update to upgrade your Windows XP system to service pack 2. You have probably already done this. If not, you need to do it in any case to fix many important security problems that have nothing to do with Apache!
Not sure if you have service pack 2? Do this: click on "Start," right-click on "My Computer," select "Properties" and look at the information presented under "System." You should see "Service Pack 2." If not, visit Microsoft's Windows Update site, using Interet Explorer, not Firefox... just this once! The Windows Update site uses special Active X controls to update your computer. Normally I don't encourage the use of Active X, but for upgrading Microsoft's own operating system from Microsoft's own website using Microsoft's own browser, it's OK!
No comments:
Post a Comment