I've been searching for the perfect Linux distro to act as a LAMP (Linux/Apache/mySQL/PHP) development environment for a number of web sites I support, and it's been a painful search. I was running Red Hat for a while, until they killed off their free version. I gave Fedora Core 2 (and then Core 3) a shot, but the networking was spotty at best. I looked at Mandrake, a Red Hat descendent, but it wasn't much better.

After working through the joys of “Dependency Hell”, I decided to give Debian decedent a try. “Apt-Get” was supposed to be a better way to get software, but Debian is a hard-core distro. Since I'm a little too n00b, I needed something with an installer. I tried a few of the live disks (like Mepis and PCLinuxOS) but they needed too much RAM to load on the low-grade PCs I used for Linux testing. I tried Libranet, but that has a bit of a learning curve to it. Perhaps I'll have a review of that later, but not quite yet.

About the only distro that set up cleanly, found everything on all of my home servers (multiple PCs, OSs, and domains), and “Just Worked ©” was Xandros, and it had some issues. First of all, Xandros is a commercial distro, and the free version is slightly gimped – it's a full release behind the “premium” version. Additionally, it forced an ad-driven version of Opera on you, and it slows your CD Burner down to 1x. And it is built to be a desktop, not a server. That means no GUI tools, no script interpreters, and no easy way to get them. I'm just not that hard core, so I put Xandros aside for a while. But, after the first two paragraphs, I came back.

As I noted before, Xandros is a desktop distro, and they never aimed to make my perfect LAMP server. Their goal is to be the first Linux distro all the nerds install for their mothers. I'm sure it would be quite nice for that purpose, but that's not what I needed. Keep in mind my twisted purposes when you read my results.

When I decided to give Xandros 2.0 Open Circulation Desktop (OCD) another shot, I chose one of my weaker PCs to be the host. The PC I went with is a 450 MHZ no-name with 128 MB of memory – a real POS but a steady performer. After making all of the necessary back-ups, I slipped the Xandros CD into the slot and booted her up.

The install process is intuitive and GUI driven. The first decision you have to make is what part of the available hard drive space you want to assign to Xandros (I chose “all”). Once you make your decision, it handles the particulars of the partitioning. Next, you'll be asked for which packages you want to install. I went with a custom selection of Apache, some text editors, the web browser, and assorted “viewer” apps, just in case.

After the initial reboot, you'll be taken directly to the Xandros windows manager (a version of KDE 3.2). You'll be walked through some final settings, like time-zone and windows “behavior” and you've got a functioning PC. Just not a “server”.

During the install, the installer asks whether you want to use DHCP or set a static IP. If you breezed through that, you can set the specifics of it now by opening up the “Control Center” (windows users can view this as the equivalent to “Control Panel”) and Choosing “Network | Network Connection”. All the usual setting will be there, although you can only set a single IP address (more on that later). You can set your DNS servers here, if you haven't already. If you'll be wanting to view Windows shares, you'll want to modify the settings under “Windows Networking” as well.

One of the first things you might want to do is go to “Peripheral Devices” and set the num lock key behavior you prefer – Linux tends to reset this every reboot, in my experience. Nothing else in the Control Center is essential at this point, but it's good to know what's in there.

The next step, at least in my case, was to make sure I could share my web folders to my Windows PC, where I do all my dev. This whole networking thing, as you may recall, is pretty much the only reason I chose Xandros, and it does this part right. The “Xandros File Manager” (XFM) can be launched from the task bar and it is a piece of work. The result of over a year of development, none of it GPL'd, it is the distro's claim to fame. From here, you can browse to a printer and mount it (I had to enter mine by name, but it mounted it instantly after that), you can browse your Windows networks, you can burn a CD (at 1x, of course), and you can view anything locally mounted. I drilled down to “/var/www”, right clicked on the folder, and chose “Sharing | Windows Sharing”. At this point, you can leave all the settings alone and hit “Ok”, and the folder will be shared. You may need to reboot the server for it to take effect, but that's really all there is to it. Likewise, you can select a Windows share, choose “Tools | Mount Network Share” and be done in that direction as well. It's that simple.

Unfortunately, that's the end of the simple part.

Remember when I mentioned that there was only room for one IP in the Control Center? Well, this is, as I said, a web dev box and I need several. The next step was to save a copy of “/etc/network/interfaces” and add my “virtual” IPs to the original. Virtual, in this case, means that the first IP is still the primary for purposes of network identification, but any others you put here will work fine as site hosts. There is no GUI for this. The format of the file looks something like this:


auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static
address 192.168.100.4
netmask 255.255.255.0
gateway 192.168.100.1
broadcast 192.255.255.255

auto eth0:1

iface eth0:1 inet static
address 192.168.100.14
netmask 255.255.255.0
gateway 192.168.100.1

auto eth0:2

iface eth0:2 inet static
address 192.168.100.24
netmask 255.255.255.0
gateway 192.168.100.1

auto eth0:3 ...

You can add as many as your network has to spare in this manner. You can “instantiate” your changes by entering “/etc/init.d/networking restart” from the command line, or by rebooting. Note: You can now no longer use “Network | Network Connection” under Control Center because it can't make sense of the virtual interfaces. That's okay because you don't need it anymore. If you do, you can temporarily restore the saved original.

Next, I needed to “create” the web sites I was going to develope on. I added appropriately named folders under “/var/www” and cracked open “/etc/apache/http.conf” to finish the task. Again, there is not GUI for this. First, you find the “virtualhost” section and add the virtual IPs like so:


If you want to use name-based virtual hosts you need to define at
# least one IP address (and port number) for them.
#
#NameVirtualHost 12.34.56.78:80
#NameVirtualHost 12.34.56.78
NameVirtualHost 192.168.100.14
NameVirtualHost 192.168.100.24
NameVirtualHost ...

Below that, the virtual hosts are attached to web sites:

#
#


ServerName mysite.local
DocumentRoot /var/www/mysite
ErrorLog /var/log/mysite_err_log


ServerName myothersite.local
DocumentRoot /var/www/myothersite/site
ErrorLog /var/log/myothersite_err_log

Back in the Control Center, you can restart Apache under “System Adminstrator | Services” to instantiate the sites. If your sites don't show up under a browser, it's most likely due to a typo.

Next, I needed to add some packages. Xandros is based upon a relatively stable (read: “old”) version of Debian, which makes it good for Linuxphobes, but not for web servers. The default package source is also a little slim on packages not meant for a desktop, so the next step is to add some package sources. “Xandros Networks” is a Synaptic-like apt-get GUI, with some really neat marketing features built in. Remember, this is a free distro. Anyway, in the interest of not breaking stuff, it's best to do your package management from here. Launch it from your desktop and choose “Edit | Set Application Sources”. You can check “Debian Unsupported” but that's not quite “edgy” enough. You'll want to also manually add at least one good “testing” source. I use “deb http://http.us.debian.org/debian testing main contrib non-free” and “deb http://non-us.debian.org/debian-non-US testing/non-US main contrib non-free”. You can use others, but we're basically just looking for a couple “Sarge” sources. Hit “Ok” and step away from the keyboard.

Now, this is key: Don't install anything yet!. I have played with the installation tools. I've even tried a direct “apt-get distro-update”. I have also had to do multiple installations to correct the results of those experiments. For this server, you're going to want to keep the package installs to the minimum, and even then, it's best to “pin” your distros.

“Pinning” essentially is the act of setting distro priorities so that “important” stuff, like Xandros system files, is not overwritten with supposedly more up-to-date stuff. To do this, you need to add a file to your “/etc/apt” folder called “prefernces”. You should probably do some Googling before playing with this but mine looks like this:


Package: *
Pin: release l=Xandros Networks
Pin-Priority: 1002

Package: *
Pin: release o=Xandros Corporation
Pin-Priority: 1002

Package: *
Pin: release a=xandros2.0-xn
Pin-Priority: 1002

Package: *
Pin: release a=testing
Pin-Priority: 777

Package: *
Pin: release a=stable
Pin-Priority: 555

Package: *
Pin: release a=unstable
Pin-Priority: 333

The numbers indicate priority, with “1000” being highest, and “1” being lowest. “1002” actually instructs the system to roll-back anything thats been overwritten to this point, but I haven't tested that, and you shouldn't, either. What this is basically saying is that Xandros custom stuff trumps everything. After that, I want files from the “testing” repository. If, for some reason, something can't be found in those those sources, apt-get should look next at the older “stable” source. If what I want isn't there either, it should look in the quasi-dangerous “unstable” source. At no point should anything from these downstream sources overwrite something from a higher ranked source. That's the theory, anyway. I was able to completely hose one set-up with the afore mentioned “distro-update”, but this should at least make the trigger a little stiffer before you blow your foot off.

At this point, it is now “safe” to start adding packages. In the past, I used “Synaptic”, but in my latest iteration, I used “Xandros Networks”. It really is no worse that the vendor neutral tool, and is less likely to cause any incompatibility. I added “Firefox”, “mySQL”, “mySQLadmin” (better than “mysqlcc”), PHP4, PHP4-mysql, and PHP-PEAR. Those last two are just extra libraries. All of these can be searched for from the GUI. This results in slightly-older-than-current versions of both mySQL and PHP, but the resulting LAMP server is pretty indicative of most production environments and is going to be more stable than the really cool bleeding edge stuff.

After I added these packages, I added the Debian security updates thoughtfully suggested in the “Updates” area and let it run for a really long time. From this point on, it's all Apache, mySQL, and PHP configuration of the sort you'll find anywhere.

One little hitch I ran across is that my modifications to /etc/network/interfaces were not being implemented on reboots. The best theory I was able to find was that it was an issue of timing – interfaces was not being called before Apache, or something like that. To get around the problem, I added “/etc/init.d/networking restart” to “/etc/init.d/bootmisc.sh”, Xandros' equivalent to the Windows “autoexec.bat”. That seems to have taken care of it. I couldn't really call this a bug with Xandros because my “primary” IP, the only one they ever intended for me to have, still worked fine.

It should also note that Xandros boots to an X log-in screen, and there doesn't seem to be anything I've found that can be done about that (trust me – I've tried). The cost is that there are few more “visual” libraries loaded on my poor little POS than is probably warranted, but it seems to be soldiering on.

On the whole, I would say that Xandros 2.0 OCD makes a pretty decent LAMP server, especially considering that it was never intended to be. At the cost of having to dig into to conf files, which was probably a good educational experience, I have an easily installed, easily maintained, and easily networked free Linux server. If you feel comfortable compiling your own kernels and have never had any problems with Samba, then you could probably do all of this with straight Debian. But it would still be easier this way.

c0c0c0