This That & Other Things

Friday, August 25, 2006

 

Setting up a home web server on a USB flash drive

I just wanted to let everyone in on a couple of “Free” programs that I found that allow you to run your own web server off of a USB thumb drive. I have been playing around with setting up my own Web Server at home for the least amount of $ and effort possible.


I found was that I could actually do it for free (minus the price of a flash drive) with the right tools and free services.

What I did was download the packages from the sites listed below and installed them on separate thumb drives. After putting my html files in the appropriate folders, I found that both worked without much fuss or additional configuration. All you really have to do is put your HTML files in the appropriate folder on the flash drive depending on which package you downloaded. Either a folder called www or wwwroot.

Note: One of the packages, chsoftware, has a file called httpaccess (it is there so you can assign additional security options). You make changes to this file through the programs Options menu. I initially had problems accessing my pages because it kept saying I did not have permission. After reading the instructions, I found the correct setting to allow access. Under Options on the server status box, uncheck the “only allow access to this server from 127.0.0.1(localhost)” entry. Then, make sure that you Check the Permission Order entry “order Deny,Allow”. It looks like you can really fine tune and control access to you web pages using the options available.

Both of these distributions are using the Apache Web Server software, plus other programs such as PHP, Perl and MySQL. I have found that using these USB Web Server packages are an excellent way to learn about web servers and their fuction without having to sign up with a hosting company or risking you PC by setting up server software on it.

Here is the first site, and my favorite http://www.chsoftware.net/en/useware/wos/wos.htm This has two versions you can download, one about 50meg in size the other 65meg. This is downloaded as a .zip file. What you need to do is uncompress the zip and then copy the contents of the created folder to the root of the thumb drive. Note: This package is comprised of Apache Server/PHP/ and MySQL

http://www.blackdot.be/?inc=apache/mobile This one is about 20meg. Since this one comes as an .exe file, you just run the program and when asked for the install directory, point to the thumb drive.

Once downloaded and installed, to enable the programs all you do is go into your thumb drive and double click whatever start program file that is referenced. The Apache Web Server will then start and point all http traffic coming in on port 80 to the appropriate folder, either www or wwwroot depending on which package you decided to use.

If you have a firewall, router, or multiple PC connected to your internet connection you will need to set the appropriate permissions and forwarding.

Ok now on to the second part. You have the software, it is up and running, your web pages are in the appropriate place, but, how do people from the outside get to your web site.

As you all know, when you go to a web site, you are basically typing a name that represents an IP address, so instead of you typing http://207.46.19.60/ (Microsoft’s IP address) you can type http://www.microsoft.com/ , much easier to remember. Basically, any computer that has access (is connected) to the internet needs to have an IP address assigned to it. Web sites need to have IP address (and domain names) so that people can access them, and you need an IP address so that your request for pages, when surfing the web, know where to go to make it back to you. It is the job of your ISP (Internet Service Provider) to assign an IP address to you.

So, after setting up your Web Server, all someone needs to do to access your site is to type into their Browser’s Address bar the IP address that has been assigned to you by your service provider (Comcast, SBC, etc.).

Now you may ask, “How do I find out what IP address was assigned to me”. Well just go to the site listed below.

http://www.whatismyip.com/

Unfortunately, this is not the most foolproof or consistent way of insuring that people can still get to your site. Most service providers do not assign there Users a static IP address (one that never changes). One reason is to actually keep people from running file servers or high traffic web sites without paying for the service, which most ISP’s provide for a cost. For a small site though, I wouldn’t worry.

Ok, how often will an ISP change your IP address? Short answer, I don’t know. It really depends on how you connect to the internet. For dialup users, you are assigned a new IP address ever time you sign in. For cable users, your IP address will usually change only when your cable modem has been disconnected for a significant span of time. I have Comcast cable service and my IP address has not changed for the better part of a year. And finally DSL, I have no idea how often it changes. DSL is a little different than cable in the fact that you usually have to login for access. About the only thing you can do to insure that someone can access your site consistently is to check your IP address using the link above and giving it out to anyone you want to visit your site and letting anyone who has visited before know that the address has changed.

Ok, I lied above when I said that the only thing that you could do was keep re-giving people your assigned IP address every time it changes. There is something else you could do that can make it easier for those who want to visit to do so without seeing the infamous “Page Cannot Be Found” error whenever your IP address changes.

Listed below are a few links for services that allow you to tie your IP address to a sub-domain that you create. [A sub-domain is a domain under the Services main domain. In my case, I use DYNU.] What these services will do is map your IP address (that you found using whatismyip.com) to your sub-domain so that people who visit your site will only have to type in “http://yourname.dynu.com”. Or in whatever format the other services require.

Now, you may ask, how does the service know when or if my IP address has changed and whether it is time to map a new IP to your sub-domain. There are a couple of ways: You could either keep track of it yourself with whatismyip.com and log into your account and update it manually, or, if you have an always on connection, you can use a small update program that most of these services provide that will run in the background in your task tray and monitor what your IP address is. When and if your IP address changes, this program will automatically update your accounts profile. Your new IP address will then be mapped to the sub-domain that you created.

Security Note: Do these background programs, monitor anything else? I don’t know. It is really up to you on how open you will make your system. Again, if security is a concern, you can monitor for IP address changes yourself and update your account manually. I have used my DYNU sub-domain for about a year, and I do run their update software so that it automatically updates the IP address in my account profile, if necessary. I have not encountered any problems thus far.

I actually starting using this service so that I could access files on my home PC using a web browser and a program called UltraVNC when I was on the road.

Again, all of the services below offer a free basic account that you can use to accomplish the above.
I use the first one, but there are others that provide the same service for free.
http://www.dynu.com/

http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html
http://www.dyndns.com/services/dns/dyndns/

Note: I have also found that with a little additional knowledge about PHP and MySQL you can run other services such as FTP's, WIKI's, Forum's, Blog's, and Chatrooms from the flash drive also.

Links for additional software that can be setup on your web server thumb drives.

All Free
Software for hosting your own Blog. http://www.bblog.com/
Become your own Wikipedia: http://www.mediawiki.org/wiki/MediaWiki
Host your own chat room: http://www.morevil.com/chatlite/ Very simple and basic. I have also found that it makes it past most corporate firewalls.
Host your own 3D chat room: http://www.weirdoz.org/visualchat/ Much more configuration options.
Host your own Forum: http://www.simplemachines.org/



Remember though, you are running all these services from a flash drive and a home connection, so the speed is not the greatest and I would assume the amount of simultaneous traffic is limited. But, if you just want to set up a hobby or family site, these packages work great.

Additional note: Most ISP's forbid the setting up a home web server as described in their Terms of Service. But ...........

Comments:
I'm really glad you posted this. I've been wanting to try out php and some other server things but I couldn't find a host that supported them. I was thinking about how it would be possible to use my own comp. to do it, but it seemed like it would cause security problems (and my dad would kill me). Today I got a cheap ($7.99 for 64MB ^^;) flash drive and knew about some thing called XAMPP that had all the software for a server and began to wonder if I could make it into one. Though I couldn't find anything about it and was starting to think it wasn't possible, now I know someone else has had luck with it so I'm not so scarred about ruining my drive.
Thanks for the info.
~Sisakat
 
Thanks for posting this! I'm about to embark on setting up some basic websites and wanted to manage my own web server since I have some knowledge of how to do it from work.

I was wondering about the whole static IP thing and the thumb drives sounds really interesting. I'm definitely going to give it a try.

thanks!
 
great article..

http://www.liputra.web.id/
http://www.indonesianlyrics.web.id/
http://myip.liputra.web.id/
http://jepes.liputra.web.id/
 
I was searching blogs,and I found your site.Please,accept my congratulations for your excellent work!If you have a moment, please visit my site: USB Flash disk Have a good day!
 
I have been looking for an article like this for a while. Excellent work, and a highly appreciative thank you.

I found the information well very explained. I am hoping to give to give it a go, as soon as I can find the time.

Incidentally, is there any support for Flash????
 
Use www.ipmango.com to check the ip.
 
Post a Comment



<< Home

Archives

November 2005   August 2006  

This page is powered by Blogger. Isn't yours?