About Mikazo Tech Blog

My name is Mike, and this blog is my way of saving people time. If someone has a specific problem that I've encountered before, hopefully these posts will save them the extraneous Googling I had to go through to solve the same problem. Also, when I have something to say about technology today, I will post my thoughts here. If this blog has helped you out, even a little bit, vote on the poll below, or let me know by sending me an email. I'm always open to exchanging links with other blogs or websites that share a similar interest.

Monday, December 22, 2008

Easy Portable Web Server

I tried and tried to get this to work in VirtualBox last summer, but I've just tried out the newest release (VirtualBox 2.1) with improved host network interface support. Before, manual bridging and network card manufacturer were issues that came into play. Now it's as easy as picking the interface you want to connect to, and it just works. Here is a small walkthrough on how to set up your very own portable web server (assuming you are using a laptop). For background, I am running the host OS Windows Vista Home Premium on an Intel Core 2 Duo, using an Intel Wireless 4965AGN wireless card.

Firstly, you will need to download the following:

  • A Linux distribution CD image that includes web server software such as Apache (I chose Debian)
  • Virtualbox 2.1


Install VirtualBox, then create a new system and virtual hard disk file. I made my virtual disk dynamically expanding up to 10.0 GB and set available memory to 256 MB.

Before booting up the new guest OS, select it from the list, then click Settings. Select Network from the list, then change the Attached to: setting to Host Interface. Select the host interface connected to the internet from the list, then click OK.

Once the machine boots for the first time, it will ask for installation media. Choose to add and mount the Linux image you downloaded, and proceed through the installation process. When installing Debian, I told it to install all web server and database packages. Your portable web server can very easily be scaled to a LAMP server by installing extra packages.

Reboot to the guest OS once it is finished installing. The Apache service should start automatically (assuming you are using Apache). Place whatever HTML files or whatever else in the /var/www/apache2-default directory. If you are behind a router, make sure to set port 80 to forward to your guest IP (found by using ifconfig or /sbin/ifconfig).

Now open up a web browser, type in your real IP address, and you should see "It Works!" or some other default page (unless you already changed it).

0 comments:

Donate to Mikazo Tech Blog