Anda di halaman 1dari 6

You can host your own web site at home, and I'll tell you exactly how!

But it mi ght not save you much money, and it definitely won't save you time. So give it s erious thought before you proceed... unless your goal is simply to learn about t he technology and have fun! The best reason to host your web site at home is to learn how it all works. For more information about the pros and cons, see should I host my own web site? Warning: running a server of any kind at home is a security risk. Security probl ems are sometimes found in server software, and these can be exploited to gain a ccess 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 Informa tion Server, you'll need to keep your version of Apache absolutely up to date to o. 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 reco mmend finding an old PC on the curb and setting it up as your home server, reduc ing the danger to your own computer. Procedures for other operating systems are similar, and most of these steps actu ally involve your router, so this article should still be helpful to non-Windows users. Here are the steps to follow to set up a web site hosted entirely on you r 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 dialu p 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 p ort) to your web server. If your ISP blocks port 80, choose an alternative port number and forward that (or get a better ISP that welcomes web sites at home, li ke 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 P rofessional, you also have the option of Microsoft Internet Information Server ( IIS), which comes standard with Windows XP Professional. But that option only al lows 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 ow n! 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 pa ge!" You are trying to access your web site by name from behind your router (from one of your own PCs). With many routers, this does not work because the router auto matically assumes any web connection to itself from inside your network is an at tempt to log into the router's configuration interface. Test from outside your o wn network or have a friend do that for you. If you can access your home-hosted web site from someone else's computer, 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. 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 vari ous other companies). If you can't do that, you'll have to host your web site in some other way. to grapple with video and audio files anyway. You don't necessa rily have to go with your phone company's DSL offering -- Check out broadbandrep orts.com for independent reviews of cable modem and DSL companies. Upload speed, not download speed, is the most important feature for hosting web sites at home . "How fast will my home-based web site 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 pa ge (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 pa ge. Now multiply by 8 and you'll know how many bits make up your home page. Divi de that by your upload speed and you'll have a rough idea how long it takes to l oad your home page under ideal conditions. There will also be latency delays slo wing 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 web site at the same time - things just slow down. For more information, see my article how fast is my web site? Step Two: Dynamic or Static DNS Other people can't talk to your web site if they don't know the address... and i f 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 addre ss doesn't change, you still need someone to host a DNS server for you, unless y ou are willing to put up with giving users a URL that begins with a string of nu mbers. This is a common requirement both for hosting web sites at home and for h osting torrents, so I've written a separate article explaining how to get a host name 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 t han 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 c onnections to your computer, you need an unchanging address to forward those con nections to. This is also a shared requirement both for hosting web sites at hom e 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 thes e steps...) then you can skip this step and move on to the next. IF you have WiF i, or more than one computer, you definitely have a router and must not skip thi s step. Now that you have chosen a static local IP for your computer, you're ready to co nfigure the router to forward web traffic to your computer.

Again, this step is needed both for web hosting at home and for BitTorrent hosti ng. 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 tha t 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 nee d to configure that firewall to allow traffic through on port 80 to reach your w eb server software. This step is also common to both web hosting and torrent hos ting... so check out my article explaining how to allow traffic on specific port s 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 He menway's great article on onlamp.com. Linux users: install the Apache packages a nd look in /var/www/html or a similar location for your web site folder. Apache is the most popular web server in the world, with nearly 70% of all web sites ru nning Apache as of January 2006, according to the netcraft web server survey. Wh y is it so popular? Because it's free, open-source, high-quality software. And y ou can run it on your Windows box at home! If you have Windows XP Professional, you can also run Microsoft Internet Informa tion 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 Wi ndows, go with Apache - and consider upgrading to at least XP Home for better ne twork 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-e nd server version of Windows. It will only host one site per computer on XP Prof essional, 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 bus inesses 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 wi th older versions of Windows, even Windows 95, can still run Apache but will hav e to jump through a few extra hoops. For complete information, check out the Apa che Foundation's Microsoft Windows Apache installation tutorial. Since that arti cle is a little old, you'll just have to bear in mind that instructions for Wind ows NT or 2000 also apply to Windows XP. The following quick-start guide applies to Windows XP, but users of older versio ns of Windows can run Apache too... if they follow the extra steps spelled out i n the Apache Foundation's Using Apache with Microsoft Windows tutorial to prepar e 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 Wi ndows Update to upgrade your Windows XP system to service pack 2. You have proba bly already done this. If not, you need to do it in any case to fix many importa nt 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 "S ystem." You should see "Service Pack 2." If not, visit Microsoft's Windows Updat e site, using Interet Explorer, not Firefox... just this once! The Windows Updat e 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 syste m from Microsoft's own web site using Microsoft's own browser, it's OK! Downloading Apache Visit the Apache HTTP Server Project home page. In the column at left, locate "D ownload!" and click on "from a mirror." The download page will appear. Scroll do wn until you locate the link to download the "Win32 Binary (MSI Installer)" dist ribution of Apache, not the "Win32 Source." That's raw source code for programme rs - probably not what you want! Click on the link for the "Win32 Binary (MSI Installer)" and wait for your brows er to save the file to disk. Installing Apache Once the download is complete, you're ready to install the software. Double-clic k on the file you just downloaded on your desktop (for Firefox) or in your downl oads folder (for Internet Explorer) to launch the installation program. The "Ins tallation Wizard" window will appear. First you'll see the "Welcome to the Installation Wizard" page. Click "Next" to continue. Next, you'll see the Apache license agreement. The Apache license allows you to share the software freely, including the source code. Select "I accept the terms in the license agreement" and click "Next." The "Read This First" page appears. Currently this page doesn't offer much speci fic information for Windows users of Apache. Click "Next." The "Server Information" page should now appear. Be sure to enter the correct in formation: 1. For "Network Domain," if you registered a hostname such as myname.is-a-geek.c om with DynDNS, enter is-a-geek.com. 2. For "Server Name," enter your full hostname, such as myname.is-a-geek.com. 3. For "Administrator's Email Address," enter a real email address for you that actually works. Users will see this when things go wrong. Bear in mind that spam mers might discover this address, so use an address that is already publicly kno wn if possible. 4. For "Install Apache HTTP Server 2.0 programs and shortcuts for..." select "fo r All Users, on Port 80, as a Service." This ensures that the software is always running, no matter who is sitting down at your computer. And a web site that is not always running is not very useful! So pick this option and click "Next." The "Setup Type" page appears next. Select "Typical" and click "Next" to move on . You'll see the "Destination Folder" page. By default, Apache installs in the fol der C:\Program Files\Apache Group, creating a sub-folder called C:\Program Files \Apache Group\htdocs to keep your web pages in. These are good choices, so click

"Next." Don't click "Change..." unless you know exactly what you're doing. Finally, the "Ready to Install the Program" page appears. Click "Install" to kic k off the installation process. The Apache server software will be copied into p lace and the Apache service will start up in the background. Along the way, a fe w Windows Command Prompt windows will flash up briefly. This is normal and you s hould let these windows do their thing and go away on their own! If you do receive error messages, the most frequent cause is that Internet Infor mation Server or another web server is already installed and "listening" on port 80, the standard HTTP port. Disable the other web server software and reinstall Apache. The "Installation Wizard Completed" page should appear. Congratulations, you hav e a web server! Click on "Finish" to complete the process. Internet Information Server Quick-Start Guide You need either Apache or Internet Information Server (IIS). You do not want bot h. Microsoft's Internet Information Server is a solid choice, and it is included fr ee with Windows XP Professional. If you don't have XP Professional, or one of th e server-oriented versions of Windows like Windows Server 2003, then IIS is not an option for you. Installing Internet Information Server 1. Make sure you have Windows XP Professional! Click "Start," then right-click " My Computer." Choose "Properties" from the menu that appears. The "General" tab will appear. Under "System:" you should see "Microsoft Windows XP Professional." If you see Windows XP Home, Windows ME, Windows 98 or Windows 95, you will not be able to use IIS. Follow the Apache Quick-Start Guide instead. 2. We're ready to install the IIS software. Select "Start," then "Control Panel, " then "Add/Remove Programs." Select "Add/Remove Windows Components" from the le ft-hand column. A list of available Windows features appears. Check the box for "Internet Inform ation Services (IIS)" and click "Next." If prompted, insert your Windows XP inst allation CD. That's all it takes! Installing IIS is very simple because it is a standard comp onent of Windows XP Professional. Step Seven: Test Your Web Site From Your Own Computer Is the web site working? Let's find out! The first test is to access your site f rom your own computer. On the same computer that is running the web server softw are, access the URL http://localhost/. You should see an example home page provi ded with your Apache or IIS web server software. If not, review the appropriate quick start guide above and figure out which step you skipped! If you received e rrors during installation, you need to resolve them before your web site will wo rk. Step Eight: Make Your Own Home Page You have a web server, but right now the "content" on the site is just the defau lt home page that came with the server software. Time to fix that! All you have to do is move your own web pages to the appropriate folder. If you followed the Apache quick-start guide, your web pages belong in this folder:

C:\Program Files\Apache Group\htdocs If you followed the IIS quick-start guide, your web pages belong here: C:\Inetpub\wwwroot First, remove the files that are already in those folders. It's not smart to lea ve "default" files lying around. What if a security problem was found with one o f these common files? Then your web site would be vulnerable. Next, copy your own web pages and images into the folder. The "home page" of you r site should be called index.html (not index.htm). Both Apache and IIS are smar t enough to know that when a user visits http://yourname.is-a-geek.com/, they sh ould act as if the user asked for http://yourname.is-a-geek.com/index.html and d o the right thing. For more information about making web pages and graphics, see how do I set up a web site? Step Nine: Test Your Web Site From The Outside World We did a lot of work here to give our computer a hostname on the Internet and fo rward web traffic through the router and firewall. Did we do it right? Only one way to be sure! Access your web site from a computer that is not on your home In ternet connection, or have a friend try it. For example, if you registered the n ame myname.is-a-geek.com with DynDNS, your web site's address is http://myname.i s-a-geek.com/. Try that address from a computer outside your home and see what h appens! If it works... great! If not, you probably made a mistake in dynamic DNS, port f orwarding, firewall configuration or local static IP configuration. "I followed all the steps and I get my router's login page instead of my home pa ge!" You are probably trying to access your web site by name from behind your router (from one of your own PCs). With many routers, this does not work because the ro uter automatically assumes any web connection to itself from inside your network is an attempt to log into the router's configuration interface. Test from outsi de your own network or have a friend do that for you. If you can access your hom e-hosted web site from someone else's computer, you don't have a problem. If you want to access your site from a computer behind your router, you'll have to acc ess it at its static local IP address instead of by name. Another possible cause of this problem: you may have turned on your router's "re mote router access" feature by mistake. People turn this on by accident because they think it has something to do with hosting a web site at home. It doesn't. T urn it off, it is dangerous! You don't want other people accessing your router a nd changing configuration settings. Congratulations! You have your own web site on the Internet, hosted entirely in your own home. Just remember: your computer must remain on, and connected to the Internet, all the time. Without a web server, there's no web site. That's why, if you choose to host at home, I recommend picking up an older computer off the curb, dusting it off, popping in at least 128MB of RAM and firing it up as a web server. Your own PC doesn't wear out, and if security problems are found in the web server, they are more likely to be confined to the less important computer.

Anda mungkin juga menyukai