Dynamic DNS with a virtual web server
Dynamic Duo
A virtual server with a dynamic DNS service might just be the easiest way for a home user to implement an Internet website.
A dynamic DNS service lets the user run a web server from a home computer without a static IP address. Dynamic DNS providers such as DynDNS.com [1], easyDNS [2], or ZoneEdit.com [3] won't even charge you for a static DNS name. If your Internet provider assigns new IP addresses to your router through DHCP, a special program – or even the router itself – will pass the new IP address on to the dynamic DNS service provider, thus updating the DNS record for uninterrupted name resolution services.
Many users are wary of installing a private server because they're afraid of vulnerabilities. An attacker who manages to compromise your web server can access your private machine and possibly even endanger important data. However, if you install a web server as a virtual machine (Figure 1), the damage is limited. If an uninvited visitor runs amok on your server, you can easily restore the system to its previous state. VMware server, for instance, lets you take a snapshot of the current system state and restore it at any time. A virtual web server also offers greater convenience and mobility. If you burn your data onto a DVD or a memory stick, you can put your server in your pocket and load it into another virtual machine on other hardware.
Step by Step
A quick overview will serve to outline the steps for deploying a VMware virtual web server system. Start by installing a virtual server. In this article, I use the free VMware server, which does not need any major network configuration. On the server, install the operating system you will be using for the virtual server as a virtual machine. In our lab, I opted for servers on Ubuntu 7.10 and openSUSE 10.3. Of course, you can choose any other flavor of Linux – many roads lead to Rome.
On the virtualized Linux system, set up the services you want to offer on the Internet. In this article, I focus on deploying an Apache web server, but the process is similar for other Internet services. If your network uses a private address space behind a firewall/router device, the server will only be accessible from the private network at first. As you will learn in this article, you can make the web server accessible from the Internet by assigning it a static IP address on the local network and then configuring the router to forward incoming port 80 traffic to the virtual server's address. If your ISP assigns an Internet address to the router through DHCP, the address will change occasionally. The Ddclient tool will notify the dynamic DNS service provider when the address changes.
The Host
The free VMware server download of version 1.0.4 is available directly from the vendor's website [4]; however, this means installing manually. Ubuntu users can adopt a far easier approach. Launch Synaptic and add another external package source (deb http://archive.canonical.com/ubuntu gutsy partner); then, click to install the vmware-server package.
The serial number you will need is also at the download address [4]. Be warned: Before you are given a serial number, you'll need to answer a whole bunch of questions. After completing the installation, access the server's GUI by pressing Alt+F2 on openSUSE 10.3 and Ubuntu 7.10 and then typing vmware. This takes you to the interface shown in Figure 2.
The next step is to install an ISO image that you download from the web. As an alternative, you can use the host system's disc drive as an installation source if you have the system on a CD or a DVD. Start by selecting File | New | Virtual Machine to set up a new, "empty" virtual machine. Then, select Next and Typical, opt for Linux as the system to install, and select an appropriate version in the drop-down menu.
In the next dialog, type a name for the virtual machine – I chose UbuntuServer and OpenSUSE10_3. Do not change the Location. Now move on to the network settings. If you select Use bridged networking, the server will be set up as a client on the local network. For test purposes, it is perfectly all right to set Disk Size to 5.0 GByte. Check the option Split disk into 2GB files if you want to copy the virtual machine onto external media. Older file systems, such as Ext2 and FAT32, have problems with large files. The server will clean up the required space on the host system if you click Finish. The virtual machine is like a computer with an empty hard disk – time to invite guests.
Hospitality
To assign some of the host system's resources to the virtual machine, click Edit virtual machine settings. Below CDROM 1, click on Use ISO image to use an ISO image as your installation resource. Click Browse to open a file manager and search your disk for the ISO file (Figure 3). If you prefer to use the standard installation medium, keep the default. Click Memory to extend the virtual machine's RAM – you will have to decide how many megabytes of RAM the virtual machine is allowed to steal.
If the host system has multiple processors, you can specify how many of them the virtual server is allowed to use in the Processors menu. When you are done, click OK to complete the configuration and then reboot the virtual machine by clicking Power on this virtual machine. If you need to change the BIOS, quickly press the Esc key – otherwise the installation will be pretty much the same as on any physical machine. In the case of an Ubuntu server, you should choose Install to Disk as your boot option.
A number of HOWTOs on the Internet describe the installation of one distribution or another. Because VMware tricks the distribution into thinking that it is installing the guest machine with standard hardware, driver problems are very unlikely. It is a good idea to click Snapshot after completing the installation to save a copy of the current system. Later on, if necessary, you will be able to restore exactly this state, and you might also want to take another snapshot when your server is up and running and the configuration is complete.
Reality Check
Although a virtual web server offers many advantages, it definitely isn't a solution for every situation. One disadvantage is performance. Systems running on virtual machines are slightly slower than systems running on the hardware. If you're expecting a high volume of visitors because you run a game server or an enormous content management system, you should make sure your server has sufficient resources or else do without virtualization.
Hardware support is also an issue with virtual machines: Your Webcam or MP3 player might not work as anticipated under VMware. The host system that houses the virtual server also needs a wired connection to your home router – virtual machines will not be able to use a WLAN connection on the host. Finally, virtual machines are not suitable for 3D applications; of course, this is not typically an issue for a server. If the virtual server is not an option for you, don't worry: The Apache web server works just fine with dynamic DNS service on the physical machine.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.