This action might not be possible to undo. Are you sure you want to continue?
by Gina Trapani Last updated: September 2006 A web server is software that continuously runs on a computer and allows other computers to download documents from it. This text that you're reading right travelled over a network connection from Lifehacker's hosting web server to your browser. Web servers are usually loud, scary, headless machines in cold windowless rooms, but you can run one under your desk at home. Why would you want to run a home web server? Maybe you want to download files on your home computer from anywhere. Like, say, your digital music collection. In this how-to, we'll set up a home web server that lets anyone (with the right password!) connect to your computer and download your MP3's from it, for a nice way to share your music collection with friends, or play a song from your home machine at the office for co-workers. Please note: Running a server on your home computer is a risky undertaking, and before you start, make sure your computer has all the latest patches and security updates, and that you've done a thorough spyware and virus scan. This tutorial is for advanced users who feel comfortable editing textual configuration files and exposing port 80 on their home computer to the internet. As always, a strong firewall with explicit user-set rules is recommended. Still game? Carry on. Let's get started. What you'll need: 1. A Windows PC  2. An always-on broadband (DSL or cable) internet connection Step 1. Install Apache HTTP server. 
in C:\Program Files\Apache Software Foundation\Apache2. and if it's not done.First and foremost. it means that the installation of the Apache web server software on this system was successful. including Windows Firewall. Download Apache HTTP Server from here. using the link next to "Win32 Binary (MSI Installer). can cause the server installation and startup to fail miserably. If the page you see reads. "If you can see this. Configure Apache to share documents from the right folder.2\. like so: Complete the installation wizard using the "Typical installation" setting. Skype. Say you want to make your music collection downloadable using your new web server ." you're golden. Trillian or any other instant messaging applications. When you reach the screen prompting for server information. Accept the license agreement and use the default location for the Apache files." Start the installation wizard. This is extremely important. disable and stop any other firewall or server software you may have running.conf . These programs and services can be started and used again as usual once we're done setting up the web server. enter your own email address and homeip. and all your music files are located in C:\Gina\My Music. open your web browser and go to http://localhost/.net  as the domain information. open the C:\Program Files\Apache Group\Apache2\conf\httpd. Using a plain text editor like Notepad. When it's done.  Step 2.
click on the Apache icon in your taskbar and choose "Restart. This is Apache's configuration file. and add another with your directory. Then. comment out the line that starts with DocumentRoot and add another with your directory. Password your web site documents. and we want to secure things a bit. enter the password you want to set up. a password file will be created. there is a line that reads: AllowOverride None Change it to: AllowOverride All When you're done. .file. Once you've done that. like this: #DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs" DocumentRoot "C:/Gina/My Music" Then. First.txt" gina Replace the path with the path of your new password file (which should in any folder EXCEPT the web server's document root." If Apache restarts successfully . open a command prompt (go to the Start menu. but most of the defaults will work just fine for us. Woo-hoo! Step 3. then type cmd.. about 20 lines below that <Directory line. save httpd. But we don't want just anyone to be able to download your music. you edited your the file correctly. which looks long and scary. We just have to change a few things. This time you should see a listing of your music files. choose Run..2\bin" Then create a password file by typing: htpasswd -c "C:\Documents and Settings\Gina\my_password_file. like this: #<Directory "C:/Program Files/Apache Group/Apache2/htdocs"> <Directory "C:/Gina/My Music"> Last.) Replace gina with the username you want to use.conf. comment out the line that starts with <Directory "C:/Program. Let's create a password prompt. Your bandwidth is precious. Visit http://localhost/ in your web browser.conf file. When prompted.) Change to the Apache bin directory by typing: cd "C:\Program Files\Apache Software Foundation\Apache2. In this httpd.
htaccess. Copy and paste the following into it: AuthType Basic AuthName "This is a private area.Now we want to apply that login to your music directory. Open up a new file in a plain text editor like Notepad.txt" AuthGroupFile /dev/null <Limit GET POST PUT> require valid-user </Limit> Make sure you replace "C:\Documents and Settings\Gina\my_password_file.34. So. Rock! Step 4. but is covered in Lifehacker feature How to access a home server behind a firewall.txt extension on the file. Enjoy your new home web server! . before . go to http://localhost/. If you are NOT behind a firewall. If your IP is 12.890.  If you ARE behind a firewall (like a wireless router). in this case.890 into a browser's address bar. Note: If you're using Notepad to create your . C:\Gina\My Music) and name it . If you're not sure what your IP is.htaccess. visit What Is My IP to find out.txt file extension. we're saving the file as C:\Gina\My Music\ . If there's a .567. when you save the file.htaccess file. Save this new file IN YOUR WEB SERVER DOCUMENT ROOT (in this case. You've got a home webserver running. Don't forget the dot in the beginning. using your web browser. This part is beyond the scope of this article.htaccess. Congratulate yourself.so that Notepad doesn't automatically put a .". please log in" AuthUserFile "c:\Documents and Settings\Gina\my_password_file. put quotes around the filename .htaccess" . you'll need to open up port 80 on the firewall and forward it to your computer.txt" in the text with your own password file created above. you can access your web server from other computers by typing your computer's IP address into a web browser's address bar.567. your password won't work! Now.34. You should be prompted to log in. then type http://12. Enter your username and password you set up in your password file.