Setting up a Home Webserver

My current web host (ICDSoft) is inexpensive and offers a large variety of valuable tools, however, I'm only offered 333MB of storage. For someone who enjoys taking pictures and posting them online, this is not much space. My officemate offered up a great solution. Turn my home computer into a webserver. With over 100GB of storage on my machine, I won't have to worry about running out of space. Here's how I did it:

Instructions

  • Installed Java on my machine -- downloaded from http://java.sun.com/j2se/1.5.0/download.jsp (downloaded the J2SE 5.0 JDK)
  • Once you install it, you then have to create an environment variable for JAVA_HOME.
    • Go to Control Panel/System/Advanced Tab, and click on 'Environment Variables'.
    • Under 'System Variables' click 'New'.
    • The name should be JAVA_HOME and the path should be to the directory you installed to (in my case, C:\Program Files\Java\jdk1.5.0).
    • You also have to add the bin directory to your path, so select the Path variable, click edit, and add this to the end of it: ;%JAVA_HOME%\bin
    • You'll have to reboot for those settings to to take effect.
  • Downloaded the Tomcat 5.0.28 .exe file from http://jakarta.apache.org/site/binindex.cgi
    • Run the install program. It should detect your Java directory, and will also ask you what port you want to run on. If you change it to port 80 (the default webserver port), then you can hit your machine directly without specifying a port, so that's what I did.
    • Hopefully, it should work then. You can run it by going to your Tomcat\bin directory and double-clicking on startup or startup-using-launcher, or you can open a command prompt and navigate to that directory and run from the command line.
    • You can test to see if it's working by going to http://localhost. If that comes up with the Apache Tomcat page, you're good to go. Then you can give people the IP address of your computer for them to be able to get to your pages (you can get that by running ipconfig at the command prompt.)

A couple of notes:

  • You should definitely install a firewall before running the webserver, since this makes your computer more vulnerable. You can get a very good free one from ZoneAlarm.
  • All webpages that you'll want to be able to view should go in your Tomcat\webapps\ROOT directory.
  • There are really good instructions on the whole process here:
    http://www.coreservlets.com/Apache-Tomcat-Tutorial/
  • It only works as long as your computer is on -- so if you want to use this as your webpage, you've got to leave your computer on all the time.

Troubleshooting:

  • If you're using a router (I have the Netgear MR814v2), this could complicate things a bit.
    • When you used ipconfig to check your IP address, you probably saw something in the 192.168.0.? range. This is your local IP. Your external IP is what others will use to access your webserver and you can get this by going to http://www.canyouseeme.org.
      • Your external IP address will be listed here.
      • You'll also see a box next to "What Port?". Enter "80", or whatever port number you used. There are technicall over 65,000 available ports, but Port 80 is the default webserver (http) port.
      • After you enter your port number and click "Check", you'll see the results below. If the check wasn't successful, you may be required to do something called Port Forwarding.
    • For reasons I can't explain, your router changes the external IP address to match it's own settings. Great instructions for Port Forwarding can be found here -- http://www.portforward.com/netgear/mr814-portforwarding.htm
    • Instructions will vary depending on your router, but you'll basically want to forward your HTTP port (Port 80) to the internal/local IP address established by your router.
      NOTE: Do not forward your port to the external IP address you discovered using canyouseeme.org as this could seriously confuse your router and take down your network.
  • ZoneAlarm Firewall settings can also be a source of headaches.

Additional Information:

treener.com digital images web tools send us an email calendar