Set Up a Debian LAMP Test Server

I mentioned in an earlier post that I’d explain how to set up a Debian GNU/Linux LAMP (Linux, Apache, MySQL, PHP/Perl) server. So here it is, complete with plenty of screenshots.

Before I get started, a disclaimer: This is a guide to set up a personal test server. I wouldn’t advise using these settings for a live website as I can’t vouch for the security of the setup.

With that out of the way, here are the instructions.

First, you’ll have to boot up from the CD (or DVD) that you downloaded and burned. This will usually just require popping the disc into the drive and powering up the system, but depending on your computer’s BIOS settings, you may need to change boot device priorities so that the system looks to the CD before the hard drive.

Collecting Information for the Installation

When your PC boots from the Debian install disc, you should be greeted with the following screen (click the images below for full-resolution versions):

Boot Screen

Choose “Install,” or, if you prefer, you can choose the graphical installation. The steps are pretty much identical, the only real differences being the fact that the graphical setup is prettier and you can use your mouse.

Next you’ll be asked to select a language:

Language

Choose your language of choice and next you’ll choose your country:

Country

Choose appropriately, then select a keyboard layout:

Country

Again, choose whatever is appropriate for your hardware. Note to Canadian users: Choose the “American English” keyboard layout unless you have a French Canadian keyboard. If you don’t, you may see some odd behaviour (eg. the “?” key may display an accented uppercase “E.”).

Setup will now attempt to connect to your network:

DHCP

If you have any trouble here, you’ll have to troubleshoot your network connection. Once you’re connected, the system will ask for a host name. This is exactly the same thing as the “Computer Name” in Windows.

DHCP

Once you’ve got a unique hostname entered, continue on to specify your time zone:

Time Zone

Be sure to specify the correct time zone (and also make sure your system’s clock is correct), or you may experience funny behaviour in the form of network timeouts, timestamps on files uploaded to the webserver not matching those on the PC you’re working from, etc.

Bookmark and Share

Sony CD Player PC

The Problem:

It has been decided that we need a home theater computer (HTPC). Cases designed for the purpose are either expensive, ugly, or they won’t fit properly with the rest of the audio/video components on the shelf. Besides, building one will be much more fun.

The Solution:

I found a nice Sony 5-disc CD player at a yard sale for $5. The plan is to cram a micro-ATX motherboard complete with all the necessities for a fully-functional machine inside. There are plenty of boards with on-board graphics and digital audio that can handle HD video as well as surround sound, so that will help keep costs down and the build simpler. The case is just about the right size for a standard power supply unit, and there should be no need for add-in cards with Ethernet, video and audio all on-board. I also plan to install an LCD display to replace the one in the original CD player.

The Results (So Far):

First, disassembling the CD player. This involved a lot of unscrewing, but not much else. Fortunately, even though the outer casing was screwed right into the internals of the CD player, the four parts that make up the case fit together quite nicely afterwards.

The CD Player Untouched The CD Player Disassembled
The CD Player Taken apart
Front Panel and Tray Bezel Empty CD Player Case
Another view Reassembled, minus the internals
Bookmark and Share

Thin Client Test Server

The Problem:

I needed a web server to practice and test with. The only extra PC that I had lying around was an old thin client.

The Solution:

I picked up a Visara UCT machine at a yard sale for $1. I didn’t know what it was, but it was obviously some sort of PC given the parallel, PS/2, USB, VGA and serial ports in the back. I was thinking maybe one of those point of sale machines. The guy selling it thought it was an old black box. They had several. I should have bought more.

The only downside to this little machine was its lack of memory (only 32 MB of RAM), and its lack of storage (a 16 MB DiskOnModule IDE device). The thing is obviously not designed to do much work on its own. It does only have a 300MHz Geode processor, but that’s good enough for basic tasks. I did some pretty cool stuff with a top-of-the-line Pentium II, 300MHz machine back in 1998. I ended up deciding that this little thing would best serve me as a test web server.

The Result:

Well, I wish I had more to report with this one. All that I did was install more memory (128MB of PC-133 SDRAM) and an old 20GB laptop hard disk drive (HDD). You try to find an operating system that uses less than 16 MB. Even Damn Small Linux – DSL – is at least triple that without anything installed, and those DiskOnModule drives aren’t free like my 20GB was. I had to use an adaptor to connect the thing to the IDE socket on the motherboard, but that was a trivial matter.

The tricky part was finding out where to draw power. This little machine doesn’t have your typical ATX power supply unit (PSU). It has a tiny, silent proprietary device to handle those duties. So, I had to find a way to connect a Molex connector to the device so that I could power the hard drive. Luckily, the motherboard had a four-pin connector not unlike the fan connectors on a typical ATX board, and exactly the same dimensions as a floppy drive’s power connector. Perfect. I just snipped the floppy/Molex connector off of a regular ATX supply, and I had a perfect adapter for this machine.

inside
Inside the Visara UCT, 2.5" laptop hard drive installed

Okay, hardware’s all hooked up. Good to go. Right? Almost. I still needed to install an operating system (OS). How to do this without a CD-ROM? I considered a network boot, and I almost tried a USB drive install, but I wasn’t convinced either would work, the latter especially. A more modern PC wouldn’t have an issue with this, but this is not a powerful system. So I took the easy, tried and true method and connected a spare CD-ROM. You can plug an ATX PSU’s Molex connectors into the IDE devices – (HDD and CD in this case) even though it’s not plugged into an external power source. Just connect it to something on the motherboard, and since the computer is turned on, current will flow through the connected wires. In my case it was the aforementioned floppy-connector-sized pins that I plugged into.

Now to install the OS. My choice was Debian GNU/Linux. Free, open-source, and robust. All that, and an ideal platform for running the world’s most popular web server: Apache. Installation was very straightforward, contrary to popular belief. After that I installed Samba to share folders with my Windows PCs, MySQL Server for a databse solution, and openSSH to administer the machine remotely via Putty. Simple.

test server complete
Completed, painted and working; stacked to give an impression of its size

UPDATE:
For those interested, I’ve written a guide to setting up a Debian GNU/Linux server like the one installed in this system.

Bookmark and Share