Upgrade update

My new fire-breathing dragon of a server is sitting idle at the moment. I would have liked to have had it up and running today, but now I’m starting to realize why it took me so long to migrate off my Pentium II-450. Setting up Linux web servers is a lot more complicated than it was in 2001.

They can do a lot more than they could in 2001 too, but when I first built that server, the process literally went in about three steps: Install Debian, apt-get install apache mysql php, then download blogging software, create a MySQL database and account for it, edit a config file, then start blogging. You could get it done in an hour, and a lot of that time was waiting for stuff to load off a CD-ROM or download over a 256K DSL connection.

Read more

Egg on my face

I dragged my computer back over to Micro Center this afternoon. It took three of us, but we got the computer working.

It’s a long story. It would have been a much shorter story if I’d remembered my rule #1. I won’t bore you with the details, except to say the second technician, upon hearing the only thing we hadn’t swapped out was the power supply, dragged a power supply out of the back. We plugged that power supply in, and heard the sweet gimme-some-memory scream from the motherboard failing to POST. Incredible. So we powered down, reinstalled the memory, and watched the system POST.

Read more

Open-source licenses, the CISSP, and the real world

You may have a question about open-source licenses on your CISSP exam. I don’t remember the specifics and wouldn’t be able to repeat them anyway, but I had a question on my exam where knowing the differences was helpful in finding the right answer.

And I had to deal with an issue this past week involving open-source technologies where the licenses made a big difference.

Read more

Nginx, a leaner, meaner web server

Arstechnica posted a nice writeup on Nginx, a cut-down webserver that does less than Apache does, but does the few things it does much faster. That’s nothing particularly new, as smaller and faster webservers have existed for as long as I can remember.

What makes Nginx different is that it can work with PHP. And therefore, it can run WordPress.

Read more

Attack of the $99 Droid-Pads

A 7-inch, underpowered Android tablet that may or may not be available at your corner Walgreen Drug Store is made some big waves today.  It’s underpowered, but it’s supposedly on sale for 99 bucks. Regular retail price is $129.

Yes, for 99 bucks, it’s a toy. But it could be a fun toy. Read more

How I changed servers midstream

When upgrading this site, I replaced the underlying hardware as well. The old server was just a dead end in too many regards to be worth upgrading in place, and besides, being able to run new and old side by side for a time is helpful.

This type of maneuver is routine work for a professional sysadmin. But it’s been at least two years since I’ve done a similar maneuver at all, and at least five years since I did it with Linux.

When I built the new machine, I gave it a unique IP address. Turnkey Linux makes getting an operational LAMP stack trivial, and depending on what you want to run on that stack, you may even be able to get that installed for you too.

Unfortunately for me, the Geeklog migration tool doesn’t seem to work with WordPress 3.0.1. So I had to get WordPress running on my old hardware in order to migrate. I chose WordPress 2.0.11 because the 2.0 branch appeared to be the current branch when Justdave wrote his migration tool, and 2.0.11 ran without complaint on the dated versions of PHP and MySQL that were on my old server.

After importing the content, I used mysqldump to export my databases. Specifically:

mysqldump --opt -u [mysql username] -p [database name, probably wordpress] > wordpress.sql

I should have gzipped the file, but I didn’t.

gzip wordpress.sql

I then connected to the old server via FTP and transferred the file. Use your favorite file transfer method; I happened to have FTP set up for my internal network.

Uncompress the file if you compressed it:

gunzip wordpress.sql.gz

Then restore the file:

mysql -u [mysql username] -p [database name] < wordpress.sql

Or, if the database already exists, like in my case:

mysqlimport -u [uname] -p [database name] wordpress.sql

Then I connected to the webserver via my web browser. WordPress 3.0.1 saw the WordPress 2.0.11 database and informed me that it needed to be upgraded. So I let it do its thing, and a few minutes later, I had a functioning WordPress site with 10 years’ worth of legacy entries.

I messed around with it for a while. Finally, I decided to go live. And at this point, I should have physically moved the new server into its permanent home. I didn’t do that, so now when I decide to move the server, I’m going to have some downtime.

To flip the IP addresses, you need to know where your Linux box stores its IP address. Debian and Ubuntu both store it in /etc/network/interfaces. As far as I can tell, Red Hat and derivatives like CentOS store it in /etc/sysconfig/network-scripts/ifcfg-eth0, but I haven’t used Red Hat or a derivative in a long time, perhaps 2003.

If worse comes to worse, try something like this to determine where it’s stored:

grep -r [ip address] /etc/

I edited the appropriate file on both boxes, changing the IP address while leaving all of the other parameters unchanged.

I then issued the command ifdown eth0 on both machines.

On my new production server, I then issued the command ifup eth0. Depending on the Linux distribution, it might also be necessary to re-issue a default route command. I didn’t have to do that.

Depending on how much Linux/Unix cred you have at stake, you could just do it the Windows way and reboot the box. Or both of them.

Once I was satisfied everything was working, I powered down the old server and celebrated.

Cheap upgrades

Yesterday, during my weekly garage sale adventures, I bought some computer equipment. Among the haul: a Biostar Socket A motherboard with an AMD Sempron 2200+ CPU and 512MB of RAM. It’s not state of the art, but can hold its own against some of the stuff still on the market, and it’s a big upgrade over the 450 MHz Pentium II that’s been powering this web site since July 2002.I swapped the board into my 266 MHz Pentium II. That first-generation P2 was a useful machine for me for a while, but mostly it’s just been taking up space. I had to do some slight modifications to get the newer board to bolt in, but it fit without too much trouble and now some of the 11-year-old hardware is useful again. It reminded me a lot of my college days, when I used to drop 486 and Pentium boards into IBM PC/ATs.

Debian installed on the upgraded system with no complaints, but I quickly found my Linux command line skills are rusty. And there have been enough changes in the last six years that I can’t just copy over /var/www and /var/lib/mysql and expect it to run like it used to.

So I’ll apply my 15 minutes per day principle. My chances of finding a block of 2-3 hours to get it all done are near zero, but I should be able to find a few minutes each day. So one day I can move the databases, then I can move the HTML and PHP another day, convert to WordPress still another day, and maybe, just maybe, have a vastly improved site in about a week if it all goes well.

Why I still like Debian

Say what you will about Debian–the development process is slow and plodding, the distribution is always trailing-edge and Debian is always the last to get everything–but installing it today reminded me why I still like it.I need a temporary holding place where I can experiment. I want to move my genealogy page to a new piece of software, and I want to migrate this blog to WordPress.

The only spare computer I have right now that works reliably is an ancient P2-266. I don’t know how that ended up being, but I’ll work with it..

The system has 192 MB of RAM. I have a pile of DIMMs, but it doesn’t like most of them. So 192 it is.

Ubuntu’s installer won’t load on this system. It tries and tries, but after several hours, the only result is a graphical screen with a heron on it and a mouse pointer.

Debian just loads in text mode and doesn’t complain. It asks a few questions along the way, and it’s slower than the last few installs I’ve done, but it’s steady.

I’m confident I could get it to work on my 486 too, if I had the need or inclination (I don’t). I’ll save the 486 for the day I want to set up a DOS box for some old-school gaming. Probably in another 10 years.

My poor-man’s SSD boots DOS really fast

So, my no-name compact flash adapters arrived today. I ripped one open like a kid at Christmas, pulled a PC off the scrap heap, yanked my 128 MB compact flash card out of my PDA, and went to town.Unfortunately I couldn’t get Xubuntu to boot, let alone install a minimal configuration, because my CD was corrupt. I wasn’t sure if I could install anything in 128 MB, but my last Debian 3.0 install was smaller than that, so I held out hope.

So I grabbed a Windows 98 SE CD. Surely that would fit in 128 megs if I left out all of the optional components, right? And if not, there’s always Doublespace, right? Wrong. The installation bombed out, saying I needed 205 megs.

The original Win98 was smaller though, right? So I grabbed that CD. It wouldn’t play either. It repeated that same 205 meg line. I’ll bet it says that to all the guys.

So I grabbed my Win95B CD. I’m pretty sure I once crammed Win95B and Office 97 onto a 170 MB hard drive. It wasn’t pretty, but hey, it was an emergency. But no joy there either. The CD wouldn’t even read. I guess I shouldn’t be surprised since it’s a CD-R that I last touched sometime in 1999. I have no idea where the original CD is, but I know where the manual and COA are, not that that helps any.

I dug around for a Debian CD. I come across those fairly often when I’m looking for something else, but tonight I couldn’t find one.

I found my OS/2 3.0 sleeve, which got me thinking, but I couldn’t find the disc. I know I could make that fit in 128 megs and it would really scream–as in, it would complain loudly about the ATI video, and it would run really fast–but I never found the CD.

So for lack of anything else to put on it, I reinserted the Win98SE disc, rebooted, picked the Command Prompt with CD-ROM option, and dropped into DOS for perhaps the first time since the Clinton administration. I ran FDISK, blew away the partition table and repartitioned it, rebooted, found FORMAT.COM hidden in the WIN98 directory on the CD, formatted the drive, remembered I had to use the /S option, reformatted the drive, copied over himem.sys, oakcdrom.sys, mscdex.exe, and whatever else I could find, and built up config.sys and autoexec.bat files by hand using copy con, since I couldn’t find edit.com anywhere on the CD. I removed the CD, rebooted, and it booted fast–into an error message saying I’d neglected the /d parameter. Considering the last time I used the /d parameter was in 1999, that shouldn’t be surprising. What is surprising is that I remembered the syntax. So I deleted config.sys and autoexec.bat, built up new ones with copy con, and rebooted again.

The Win98 splash screen flashed, then I got a familiar DOS prompt, including indicators that the CD-ROM driver was working. It took about as long to boot as it did for the BIOS to do its thing–probably 1-2 seconds. Not bad for $7 worth of hardware ($5 for the adapter from Compgeeks, and $2 for the CF card from a garage sale).

Supposedly Windows 2000 can shrink down to 60MB if you get really aggressive with nLite. I’d really like to see that, but that means I’ll have to find my Windows 2000 CD. I’m sure it’s hiding somewhere in Argentina, playing cards with my OS/2 3.0 and Debian CDs.

I also ought to download Debian 3.0 again. I’m thinking 60-120 megs of Debian is probably more useful than 60 megs of Windows, but I really want to see how quickly Windows 2000 boots off flash.

Supposedly these cards support UDMA, so I probably ought to order some larger CF cards so I can do something really useful with them. Seeing DOS boot instantly is enough to convince me that these things can be useful. Who knows, I might be insane enough to try running my webserver off flash (the memory, not the obnoxious Macromedia/Adobe product).

Setting the MTU automatically in Debian

I run this website off a server running on an ADSL line in a spare bedroom of my home. That causes some weird issues from time to time, like the time I had to figure out setting the MTU automatically in Debian.

Why Debian?

My server of choice is Debian, because it’s Linux which makes it fast, reliable, and cheap, and Debian makes it pretty easy to install only what you want and need, so I can have a server OS that’s only using 125 megabytes of disk space, leaving most of my drive available for content. I like having space for content.

This will work in Debian-derived systems like Ubuntu and Linux Mint too.

PPPoE issues

Now, the downside of modern DSL: Southwestern Bell, like most ISPs these days, uses PPPoE. So not only can your IP address change with no notice whatsoever, you also have the hassles of PPPoE. With the default settings, some unknown but noticeably large percentage of web users won’t be able to access a web server running on a DSL connection using PPPoE.

The reason is MTU and fragmentation.Yes, you remember MTU if you used Windows 9x back in the bad old days of dialup. Tweakers would play around with the MTU settings in hopes of squeezing just a little more performance out of their 56K modems, and they would swear that one utility did a better job than any others, or that this MTU setting was optimal and the conventional wisdom of 576 stank… Remember those flamewars?

Well, with broadband, theoretically the right setting to use is 1500. Trouble is, PPPoE steals some of that packet space, and the result is something worse than slow speeds. In some scenarios, you completely vanish.

Setting the MTU

The way to make my website reappear is to issue the command ifconfig eth0 mtu 1472. The exact number doesn’t seem to matter much. It appears for me that 1472 is the maximum I can use. (It can vary from ISP to ISP, in case you’re wondering.)

Excellent. Problem solved.

Not so fast. Problem solved until my server reboots. Linux doesn’t need to reboot, right? Right you are. But here in St. Louis, the power likes to hiccup a lot, especially in the summertime. My server is on a UPS, but every once in a while, in the middle of the night, there must be a long enough power failure that my UPS dies, because every once in a while I fall off the ‘net again.

To set the default MTU permanently–that is, to change it automatically on bootup–one normally would change the ifup script or the rc.startup script. Except Debian doesn’t have either of those.

My kludgy solution: cron. Log in as root, issue the command crontab -e, and add the following line:

*/2 * * * * ifconfig eth0 mtu 1472

With this in place, only seconds will elapse between the time my power comes back on for good and I reappear on the ‘net. I can live with that.

More Debian tricks

If you change your network card or motherboard, you don’t have to reinstall Debian but you may lose eth0. Here’s how to get eth0 back. And here’s how to get a list of the installed packages in Debian.