These are Brian Schoenbaechler's ramblings, rants, and raves about his life trying to grow his Small Business.

Sunday, September 11, 2005

How to set up a personal home web server

How to set up a personal home web server

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:


A Windows PC [1]
An always-on broadband (DSL or cable) internet connection

Step 1. Install Apache HTTP server. [2]

First and foremost, disable and stop any other firewall or server software you may have running, including Windows Firewall, Skype, Trillian or any other instant messaging applications. This is extremely important, and if it’s not done, can cause the server installation and startup to fail miserably. These programs and services can be started and used again as usual once we’re done setting up the web server.

Download Apache HTTP Server from here, using the link under “best available version” next to “Win32 Binary (MSI Installer).” Start the installation wizard. Accept the license agreement and use the default location for the Apache files, in C:\Program Files\Apache Group\Apache2. When you reach the screen prompting for server information, enter your own email address and homeip.net [3] as the domain information, like so:



Complete the installation wizard using the “Typical installation” setting.

When it’s done, open your web browser and go to http://localhost/. If the page you see reads, “If you can see this, it means that the installation of the Apache web server software on this system was successful,” you’re golden. [4]

Step 2. Configure Apache to share documents from the right folder.

Say you want to make your music collection downloadable using your new web server [5], and all your music files are located in C:\Gina\My Music. Using a plain text editor like Notepad, open the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file. This is Apache’s configuration file, which looks long and scary, but most of the defaults will work just fine for us. We just have to change a few things.

In this httpd.conf file, comment out the line that starts with DocumentRoot and add another with your directory, like this:


#DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
DocumentRoot "C:/Gina/My Music"

Then, comment out the line that starts with


Last, about 20 lines below that
require valid-user


Make sure you replace C:\Gina\my_password_file in the text with your own password file created above. Save this new file IN YOUR WEB SERVER DOCUMENT ROOT (in this case, C:\Gina\My Music) and name it .htaccess. Don’t forget the dot in the beginning, before .htaccess. So, in this case, we’re saving the file as C:\Gina\My Music\ .htaccess.

Now, using your web browser, go to http://localhost/. You should be prompted to log in. Enter your username and password you set up in your password file. Rock!

Step 4. Congratulate yourself. You’ve got a home webserver running.

If you are NOT behind a firewall, you can access your web server from other computers by typing your computer’s IP address into a web browser’s address bar. If you’re not sure what your IP is, visit What Is My IP to find out. If your IP is 12.34.567.890, then type http://12.34.567.890 into a browser’s address bar. [7]

If you ARE behind a firewall (like a wireless router), you’ll need to open up port 80 on the firewall and forward it to your computer. This part is beyond the scope of this article, but will be covered in a future Lifehacker feature.

Enjoy your new home web server!

— Gina Trapani




FOOTNOTES:

[1] Sorry Mac folks, but OS X comes with a web server all set up, so this tutorial’s not for you. [back up]

[2] There are other web servers out there, but we’re going with Apache HTTP server because it’s free, stable, and my favorite. [back up]

[3] It doesn’t matter what domain you put here. I chose homeip.net because it’s descriptive, and one of DynDNS’s home domains. [back up]

[4] A common during-installation error with Apache reads, “Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down. Unable to open logs.” This means that some other server program (like Skype) is interfering with Apache. To figure out what program it is, open a command prompt and type:

netstat -a -oFind the PID (Process ID) of the program running on your local machine on port 80 (or http.) Then open the Windows Task Manager (Cntl-Alt-Del). In the View menu, choose Select Columns, and check off PID. Then match the PID to the running process to find out what server program is running, and stop the program. Then retry the Apache installation. [back up]

[5] There are tons of uses for your personal web server beyond a password-protected jukebox. Publish your blog at home, host a personal wiki, share video files and photos. Basically any file you want to publish as read-only is a good candidate. A home web server has the advantage over special server/client software because it only requires a web browser to connect to it. [back up]

[6] If Apache doesn’t start correctly, it’s because it can’t read the httpd.conf file, which means you probably had a typo in your changes. Check your changes very carefully, save and restart Apache to try again. [back up]

[7] Keep in mind that depending on your internet service provider, your computer’s IP address may change. There’s an easy way to set up a memorable name that doesn’t change, but that topic will be covered in an upcoming Lifehacker feature. [back up]

20 Comments:

Anonymous Anonymous said...

This is a excellent blog. Keep it going. Don't miss visiting this site about how to buy & sell everything, like music on interest free credit; pay whenever you want.

8:07 PM

 
Blogger meganandres7478 said...

i thought your blog was cool and i think you may like this cool Website. now just Click Here

4:33 AM

 
Blogger walterprehiem59689277 said...

I really enjoyed your blog. This is a cool Website Check it out now by Clicking Here . I know that you will find this WebSite Very Interesting Every one wants a Free LapTop Computer!

11:02 PM

 
Anonymous web hosting company for small business said...

Hey this blog is not about ftp web hosting. Silly internet bringing me here :-) Funny I have been doing hours of research on ftp web hosting and it brought me to your blog on this post. The web plays funny games sometimes. Anyways, I was reading your blog Brian and I think it is really cool. Keep up the great work.
If you do not mind I will snag your blog and put it in my favorites. I read a ton of stuff on here that interested me. Keep blogging away :-)

3:01 PM

 
Anonymous lowcost web hosting said...

Sad to say I just got back from a bowling tournament and decided to log in and do some websurfing. Brian I love your blog. I had some very good laughs. I am doing a paper on small business web hosting services and have been downloading information for the last hour. I don’t know how I came across this post but I am glad I did. It has set me back a little because I have spent the last hour reading your archives. If you don’t mind I would like to add you to my favorites so I can back again and read some more. Well I need to get back to small business web hosting services. I am almost finished with it. Great job.
p.s some very good points on your blog

6:40 AM

 
Anonymous calgary web hosting said...

Hey this blog is not about best web hosting company. Silly internet bringing me here :-) Funny I have been doing hours of research on best web hosting company and it brought me to your blog on this post. The web plays funny games sometimes. Anyways, I was reading your blog Brian and I think it is really cool. Keep up the great work.
If you do not mind I will snag your blog and put it in my favorites. I read a ton of stuff on here that interested me. Keep blogging away :-)

4:45 PM

 
Anonymous net web hosting said...

Hey this blog is not about commercial web hosting. Silly internet bringing me here :-) Funny I have been doing hours of research on commercial web hosting and it brought me to your blog on this post. The web plays funny games sometimes. Anyways, I was reading your blog Brian and I think it is really cool. Keep up the great work.
If you do not mind I will snag your blog and put it in my favorites. I read a ton of stuff on here that interested me. Keep blogging away :-)

7:06 AM

 
Anonymous personal web site hosting said...

Well I just got back from the gym and I am beat. I am currently doing some research on commercial web hosting and stumbled across your blog. Which cracks me up really. The internet can certainly land you off base sometimes. Even though this post is not completely related I think it is a cool blog. I have read back through the archives and lots of people make some very good points. Well I have been on-line forever it seems. I need to continue to plug away at commercial web hosting. If you have the energy swing by commercial web hosting. I try to update my site weekly and maybe you will see something you like. I already snagged your URL and put it in my favorites. If you do not mind I will be back again. Great job!

7:11 AM

 
Anonymous calgary web hosting said...

Hey Brian. Very nice blog :0) I just got inside from washing and waxing my truck. It is my baby. Took me 2 hours though. So I settled down into my basement and started doing some web surfing. Anyways I am in the process of grabbing my masters degree and have spent the last 6 months researching best web hosting company. In the midst of my surfing I landed smack dab in the middle of your blog. I hope you do not think I am intruding but I must say it is great blog. Even though this post is way off base from best web hosting company I found myself cruising through your blog archives for the last half hour :0) You have some nice blogging friends. Anyways, I need to get back to my mission. I wrote don’t your url and feel free to visit me here at best web hosting company. I am so busy so I can only update my site monthly. Keep up the great work.

6:25 PM

 
Anonymous best web hosting company said...

I love your blog Brian. How long has it been on-line? Reason I ask is I am doing a ton of work in the area of small business web hosting services and will probably end up starting a blog of my own. Funny how the internet brought me here when I was doing searches on small business web hosting services. Oh well, I am glad it did. Keep up the great blogging and I am sure I will visit this post again!!

3:48 PM

 
Anonymous web space hosting said...

All I can say is WOW Brian. The other half and I just got back from our friends house (well her friends house) and I needed a huge break. I am working on a project right now that is based on best web hosting company. I have literally been on-line for 2-3 hours doing research. Even though this post really isn’t on the same page as best web hosting company I am certainly glad I came across your blog. There are a ton of great view points on this blog. Well I think I can here the kids screaming in the background. I put you in my internet favorites and I will certainly come back and visit. If you want to take a peek at my site you can find me here at best web hosting company. I update my site very frequently. Again, great job blogging and I will be back again soon!

12:15 AM

 
Anonymous web hosting company for small business said...

What up Brian! I just finished up a ten hour work day and decided to kick back and do some surfing. So I grabbed myself a drink and stumbled across your blog while doing some research on web space hosting for a upcoming project I am doing. Well even though this post isn’t what I was looking for I really enjoyed reading your blog. Your doing a great job and please keep up the good work. Lots of people do not keep their blogs up to date :0) There are some very interesting view points stated here. Anyways I am going to grab the bull by the horns and continue to plug away at web space hosting. I have already bookmarked your blog. You many want to visit me at web space hosting. You never know you might see something you like! Again great job.

5:32 PM

 
Anonymous best web hosting company said...

Hey Brian. Very nice blog :0) I just got inside from washing and waxing my truck. It is my baby. Took me 2 hours though. So I settled down into my basement and started doing some web surfing. Anyways I am in the process of grabbing my masters degree and have spent the last 6 months researching small business web hosting services. In the midst of my surfing I landed smack dab in the middle of your blog. I hope you do not think I am intruding but I must say it is great blog. Even though this post is way off base from small business web hosting services I found myself cruising through your blog archives for the last half hour :0) You have some nice blogging friends. Anyways, I need to get back to my mission. I wrote don’t your url and feel free to visit me here at small business web hosting services. I am so busy so I can only update my site monthly. Keep up the great work.

4:05 PM

 
Anonymous web hosting company for small business said...

I love your blog Brian. How long has it been on-line? Reason I ask is I am doing a ton of work in the area of best web hosting company and will probably end up starting a blog of my own. Funny how the internet brought me here when I was doing searches on best web hosting company. Oh well, I am glad it did. Keep up the great blogging and I am sure I will visit this post again!!

2:32 PM

 
Anonymous web space hosting said...

Hi Brian your blog is really great! Wow :-) As I was out blog surfing and surfing the web for detailed info on personal web site hosting I stumbled across your blog. Obviously my search landed me here and it is a little off subject compared to this post, but I am certainly glad I did come across your blog. Did I already tell you I like it! If you would not mind, I would like to add your link to my "favorites" page to come back and read again sometime. Should you ever need it, there's lots of information on this site about personal web site hosting. Again, great blog and keep up the great work!

6:14 AM

 
Blogger markammons00636089 said...

Make no mistake: Our mission at Tip Top Equities is to sift through the thousands of underperforming companies out there to find the golden needle in the haystack. A stock worthy of your investment. A stock with the potential for big returns. More often than not, the stocks we profile show a significant increase in stock price, sometimes in days, not months or years. We have come across what we feel is one of those rare deals that the public has not heard about yet. Read on to find out more.

Nano Superlattice Technology Inc. (OTCBB Symbol: NSLT) is a nanotechnology company engaged in the coating of tools and components with nano structured PVD coatings for high-tech industries.

Nano utilizes Arc Bond Sputtering and Superlattice technology to apply multi-layers of super-hard elemental coatings on an array of precision products to achieve a variety of physical properties. The application of the coating on industrial products is designed to change their physical properties, improving a product's durability, resistance, chemical and physical characteristics as well as performance. Nano's super-hard alloy coating materials were especially developed for printed circuit board drills in response to special market requirements

The cutting of circuit boards causes severe wear on the cutting edge of drills and routers. With the increased miniaturization of personal electronics devices the dimensions of holes and cut aways are currently less than 0.2 mm. Nano coats tools with an ultra thin coating (only a few nanometers in thickness) of nitrides which can have a hardness of up to half that of diamond. This has proven to increase tool life by almost ten times. Nano plans to continue research and development into these techniques due to the vast application range for this type of nanotechnology

We believe that Nano is a company on the move. With today�s steady move towards miniaturization we feel that Nano is a company with the right product at the right time. It is our opinion that an investment in Nano will produce great returns for our readers.

Online Stock trading, in the New York Stock Exchange, and Toronto Stock Exchange, or any other stock market requires many hours of stock research. Always consult a stock broker for stock prices of penny stocks, and always seek proper free stock advice, as well as read a stock chart. This is not encouragement to buy stock, but merely a possible hot stock pick. Get a live stock market quote, before making a stock investment or participating in the stock market game or buying or selling a stock option.

3:06 AM

 
Blogger edwardprehiem13252736 said...

I read over your blog, and i found it inquisitive, you may find My Blog interesting. My blog is just about my day to day life, as a park ranger. So please Click Here To Read My Blog

3:25 AM

 
Anonymous ecommerce software said...

Hi Brian, I was just blog surfing and found you! Wow, I really like this one.
It’s such a pleasure to read your post …. Interesting! I was over at another site

looking at inventory software

and they didn't go into as much detail as you, but nonetheless interesting.

4:23 PM

 
Anonymous pos system said...

Hey this blog is not about ecommerce software

I have been doing hours of research on "Accounting-Software" and it brought me to your blog on this post. Anyways, Brian I was reading your blog and I think it is really cool. It’s really a pleasure reading your posts! Keep up the great work.

Keep blogging away :-)

12:58 PM

 
Anonymous pos system said...

Hey, you have a great blog here! I'm definitely going to bookmark you!
I have a pos system site/blog. It pretty much covers pos system related stuff.
Come and check it out if you get time :-)

3:21 PM

 

Post a Comment

<< Home