Oh, the pain!
October 12, 2010 | Last week the old Compaq refurb computer that I have been using as a development web server for lo these many, many years — died. I had discovered it rebooting at an unusual time and assumed Windows must have updated itself or something. But it kept trying to reboot: it would start to load Windows and get as far as displaying an empty desktop, then it would shut itself off and try again. And again. And again.
I've had this happen with other computers — all of them HP computers (harrumph!) — and it has turned out to be a failing power supply or mother board. In all those cases, I've simply extracted the hard drive, plugged it into another computer, and copied off all the data files. This time, however, it went through so many aborted reboots that the disk got corrupted and completely unreadable. Argh!
OK, no big problem. I always have two identical copies of every website, one on the development server at home and a second one on a production server at my web host. It's just a matter of firing up FTP and downloading the site.
Download onto what? I decided to make an old Linspire system (see sidebar) into a full-fledged, "real" Linux server. I downloaded the Ubuntu server and set up the LAMP environment: Linux, Apache web server, MySQL database, and PHP scripting language. That part was easy: put a CD with the Ubuntu image in the CD drive, restart the computer, answer a few questions, and pick "packages" to download and install.
That's when the agony started. Faced with a blank screen and a command prompt, I quickly realized that I didn't have a clue how to proceed. We're talking remedial Linux here — How do I shut down the system? What kind of files are supposed to go in the directories of the file system? (Names like
bin, etc, var, usr, and so on are not very self-explanatory.)
Sure, the default "website" worked, but Where do I put my own websites, and how do I configure it to serve them up?
I had been teaching myself database-driven website development, but the course I was following insisted that I download and install the "real" Apache, PHP, and MySQL directly from the separate websites, rather than use a pre-packaged WAMP server (Windows, Apache, MySQL, and PHP). It would help me understand better how the pieces all worked together, supposedly.
And indeed, the LAMP package had things configured quite differently, so what I had learned wasn't very useful. For example, the LAMP installation does not use a vhosts.conf file; instead you're supposed to put individual configuations for each website in /etc/apache2/sites-available/ and then enable them by running a utility a2ensite that will build symbolic links in /etc/apache2/sites-enabled/.
The little bit I knew about HP-UX from using Unix workstations at HP is obviously irretrievably lost among the other trivia in my brain.
And by the way, how the hell am I supposed to edit a file in Linux? There's no Notepad. It turns out that you have a choice of Nano or Vim, neither of which I knew existed on the system, much less how to use them. Vim turned out to be quite easy to use once I found a cheat-sheet listing the commands available.
Oh yeah, I forgot to mention that if you just enter the Linux commands, as listed in the various references, you will be told that the command failed because you didn't have the proper permissions. Instead you must prefix the command with sudo (pseudo) which lets you pretend to be the big Kahuna "root" without having to know the password for "root."
But, the story has a pseudo-happy ending: after two and a half days, I finally have my three sites up and running on my new Ubuntu server, and I can access them from the browser on each of my two laptops and even get to the files with Windows Explorer. Whew!
Now, where did I put that bottle of Maker's Mark?
Last updated on Jun 21, 2016