August 2002

And, we have our lucid moments…

by Michael Alderete on 8/31/2002

And, we have our lucid moments…

{ Comments on this entry are closed }

Save $70 on Adobe Photoshop Elements!

by Michael Alderete on 8/30/2002

The most aggravating thing I’ve found about having upgraded to Mac OS X has probably been the lack of my standard graphics applications. I own Photoshop and Illustrator, and for a while they were not native, and now that they are, the upgrades are $149. Each. So I’ve been doing without.

The problem is, I very frequently need a graphics tool to do some resizing, cropping, and minor touch-ups to graphics and photos. With Jaguar, and iChat, I’ve started using Instant Messaging more, and decided I wanted to have a custom chat icon. So once again, the lack of a native graphics app was driving me crazy.

Fortunately, Adobe (and finally came to my rescue, with the release of Photoshop Elements 2.0, with native support for Mac OS X.

The best news was there are two special offers on it right now. Between the School of Rebates at ($40), and the Adobe upgrade rebate ($30 if you own a wide range of graphics apps), my net cost for this fairly good piece of software is $29. And just dropped their regular price by $9, so now you can get Photoshop Elements for only $20!

The bad news is that’s sale ends on September 3rd, so you need to act fast if you want to get it. Go and buy it now!

Photoshop Elements 2.0 includes both Mac OS and Windows versions on the same CD, and is OS 9 and OS X compatible. There’s plenty about it that’s not as good as other products, but for $20, I doubt if there’s a better graphics application for any operating system.
Photoshop Elements at
Rebates Details, Save $70

{ Comments on this entry are closed }

Whoa! Quartz Extreme!

by Michael Alderete on 8/29/2002

I was trying to make an alias in List mode today, and ran across something I hadn’t seen before in Mac OS X. Has anyone else seen this? I haven’t seen this tip yet, but I’m a couple days behind on everything Jaguar right now.

Here’s a way to move around in a Finder window that’s sort of like using the Spacebar in Photoshop to pan around in an image:

  1. Open a Finder window in Icon or List mode (i.e., not Browser mode).
  2. Hold down the Option and Command keys, and click-and-hold anywhere in the window that is empty (any whitespace counts as empty in List mode). You must not actually select anything with your click, or you’ll make an alias in the next step.
  3. Your mouse cursor changes to a grabber hand. Move it around to move the whole window contents around inside the window frame.

I thought this was a pretty cool demonstration of the new features of Quartz Extreme (or at least Jaguar), and actually potentially useful.

Old news? Already posted at Mac OS X Hints? Let me know!

{ Comments on this entry are closed }

Jaguar Upgrade: Terminal Problem

by Michael Alderete on 8/27/2002

This is the eighth in a series of posts I’m writing about my upgrade to Mac OS X 10.2 “Jaguar”. See my introduction to the series for the other posts.

Today’s posting is a little different. Instead of posting about my solution, I’m posting about a problem — with enough details that hopefully we can figure out the answer together. There are changes in the Unix environment which affect the use of Terminal (or the shell in general, in Unix terms). Specifically, I have a number of shell scripts, which I’ve put into my ~/bin directory, which are no longer being found when I try to use them at the command line. They work fine if I give the full path to them, but can no longer be started by their names alone.

There seems to be some differences in the way that tcsh, the default shell for Mac OS X, is initialized, and that seems a likely culprit. When I compare my archived system with the live system, I can see that some apparently interesting files have been moved to a location that seems like it makes them inactive:

Old System: /usr/share/init

  • aliases
  • completions
  • environment
  • login
  • logout
  • rc
  • tcsh.defaults

New System: /usr/share/tcsh/examples

  • aliases
  • completions
  • environment
  • login
  • logout
  • rc
  • tcsh.defaults

The files themselves appear to be the same, but they’ve been moved to a location where they may not be activated.

The README file gives clues as to where one should put the login, logout, and rc files to make them active for a user, or for the whole system. But it’s not at all clear what one should do with the aliases, completions, or environment files.

Any suggestions? E-mail me at the address in the sidebar! (And help me test the new ;-)

{ Comments on this entry are closed }

Rant in favor of Unix

by Michael Alderete on 8/25/2002

I know that many people, especially the folks clinging to Mac OS 9, are not fond of, or particularly interested in learning to use, the Unix layer of Mac OS X. Unix is not pretty, but it is powerful. It’s baroque, but it’s incredibly well-designed. It’s not intuitive, but once you know it, it’s far faster than the GUI for many tasks.

You may as well get used to it, Unix is a part of your life if you stay with the Mac. If you can get past your initial phobia, and treat it as something exciting to explore, a new thing to learn, an opportunity to be an expert, you will become more powerful than you could possibly imagine (to steal a quotation). Neal Stephenson’s article, In the Beginning was the Command Line, is a fun look at this concept.

Personally, I love the command line, though I wish I was more expert. I get by pretty well, but seek to achieve guru status in the next two years.

{ Comments on this entry are closed }

A funny kind of sandwich

by Michael Alderete on 8/25/2002

I was on the other day, and noticed in their Video section an interview with Ken Bereskin, director of marketing for Mac OS X at Apple, talking about Jaguar. Of course I couldn’t resist, and after choosing a video format, I saw David Coursey introduce the clip about to be played. Then there was a commercial, then the six and a half minute segment with David and Ken talking about Mac OS X 10.2, and then another commercial.

The funny — or not so funny — is that both commercials were from Microsoft.

{ Comments on this entry are closed }

Jaguar Upgrade: Belated Introduction

by Michael Alderete on 8/25/2002

This is the seventh in a series of posts I’m writing about my upgrade to Mac OS X 10.2 “Jaguar”.

Series Overview

  • Belated Introduction
    What is this series, who am I, and why am I qualified to tell you anything. (This posting.)
  • Prequel
    Just a short post that I thought served as an introduction, until I re-read it today.
  • Install Options
    Describes the four different upgrade options available from the Jaguar Installation CD, with some details of what they’ll do.
  • What Gets Archived
    Details what files and directories get archived when you use the Archive & Install option to perform a “clean install” upgrade to Jaguar.
  • Post-Install Setup
    There’s a fair amount of work to do after an Archive & Install; this is the first set of things I did, focused on the Mac side of things.
  • Post-Install Unix Stuff, Part I
    There’s work to do on the Unix side, too, if you’re using tools like MySQL and PHP. This post is mostly about fixing MySQL.
  • Post Install Unix Stuff, Part II
    More Unix configuration work, this time for PHP and Apache.

I realized today that I really didn’t provide a good introduction to this series, what the purpose was, etc. So I’m going to pause in the regular postings, and start at the beginning.

I’ve been a Mac user continuously since 1984, and have used virtually every version of Mac OS. My first job was doing end-user computer support for more than 100 Mac users, and I worked there in various roles for more than five years. I’ve even sold Macs, as an Apple Student Rep in college. I’ve also used Windows, mostly Windows 2000. I’ve used Unix quite a bit, mostly since I got into doing web development, and became frustrated with the limitations of Mac OS as a reliable server. And I worked at Be Incorporated for three years, where I fell in love with the idea of an operating system that effectively married a beautiful GUI with a powerful Unix-like subsystem.

So, I’m hardly a typical Mac OS X user, or at least, hardly a typical Mac OS X user who is “switching” from the Classic version to the New version. I love Unix, and I’m not afraid to admit it in public. For me, Mac OS X is a beautiful piece of work. Deeply flawed (file meta-data, anyone?), but still brilliant. I switched from Mac OS 9 to Mac OS X 10.1 shortly after it came out, and I can literally count on my fingers and toes the number of times I’ve booted back into Mac OS 9 proper since then — most of those to run DiskWarrior.

My goal in writing these postings was to start to develop the body of knowledge that I once had for Mac OS Classic. In particular, the “best practice” of doing a clean install when upgrading to a major new release of Mac OS was something I understood extremely well.

But with Mac OS X, the rules have all changed. The core operating system is still stored in a directory named “System”, but that directory is vastly more structured and complicated. And there are dozens of other places where system components and preferences are located, to say nothing of the many more locations where third-party software can be installed.

It’s a brand new world, and while I was sure that doing a clean install was still a best practice, I no longer knew how to perform a clean install, or at least do one efficiently. My Jaguar upgrade was to be my first, and I not only didn’t want to lose a scrap of hard-won knowledge, I wanted to share it with others, and learn from them, so that I could get up the knowledge curve quickly.

So I started these postings. Hopefully they are moderately interesting or useful. This series isn’t supposed to be a review of Jaguar; everyone else is doing that, much better than I could. This is working knowledge, and I hope you’ll read and learn, and share with me the things you know that I don’t.

Final thought: I don’t talk about it in the articles themselves, but I made a total of four full-system backups before I started. Two of them were stored off-site. Yes, I’m paranoid, but with good reason. Back up your system before you upgrade.

{ Comments on this entry are closed }

Jaguar Upgrade: Post Install Unix Stuff, Part II

by Michael Alderete on 8/24/2002

This is the sixth in a series of posts I’m writing about my upgrade to Mac OS X 10.2 “Jaguar”.

This posting is a continuation of yesterday’s discussion, covering the post-installation work I had to do to get my most important Unix tools working when I upgraded to Jaguar. Just to recap, here are the tasks I had to work through to get this weblog publishing system working again:

  • Restore MySQL to working order

  • Change the MySQL user and group IDs back to their original IDs

  • Restore (or rewrite) the Startup Item that starts the MySQL data server at boot time

  • Re-add the MySQL startup flag to my /etc/hostconfig file

  • Re-enable PHP in my Apache configuration file, /etc/httpd/httpd.conf

  • Restore my php.ini PHP configuration file

  • Restore my custom user-level Apache configuration file, /etc/httpd/users/<i>username</i>

Yesterday covered the first four items, concerning MySQL; today we’ll look at the last three, covering Apache and PHP issues.

Re-enable PHP in Apache configuration file

The web server at the heart of Mac OS X’s “Personal Web Sharing” feature is an Open Source project called Apache. To call Apache “Personal Web Sharing” is something of a misnomer; Apache is truly an industrial-strength web server, and proves it by being the number one web server on the Internet, with more than 63% market share (in August 2002). Apple has made Apache incredibly easy to use for Mac OS X users, but they’ve done it by hiding much of Apache’s power and flexibility. To really take advantage of it, especially to add new “modules” to it, you have to fiddle with Apache’s configuration file, /etc/httpd/httpd.conf.

Apache is the most popular web server, and the most popular add-in, or “module” in Apache parlance, is a powerful web scripting language called PHP. PHP is actually included with Mac OS X by default, but it’s deactivated in the Apache configuration file. PHP is the intelligence, the programming language that this weblog application is written in, so I have to have PHP activated.

Which I had done in Mac OS X 10.1, However, as part of the Archive and Install method of upgrading to Jaguar, the entire contents of the /etc directory was archived, which means the changes to my Apache configuration got deactivated.

For most of my other configuration files which were archived, I simply copied them back into place. But for the Apache httpd.conf file, first I compared my old file with the version that Apple included in Jaguar. There were enough changes, all the way through the file, that I decided I didn’t want to replace the new file. That meant I needed to re-apply the various changes I had made, primarily to activate PHP.

All of this is preamble to what is actually a very simple task, made slightly more difficult by the fact that /etc is an invisible directory, and the fact that /etc/httpd/httpd.conf is owned by root, to protect it from accidental mangling which would prevent Apache from working. Not a big deal if you have BBEdit; dealing with permissions issues so gracefully, by making a Unix complexity into a Mac OS experience, is what makes BBEdit such a joy to use.

A friend of mine, Joe Lewis, has written instructions for activating PHP in Apache on Mac OS X. He wrote the instructions for version 10.1, but they pretty much hold true in Jaguar. His instructions are thorough and include plenty of screen shots, so my instructions here will be brief.

First I uncommented two lines, fairly early in the file. The lines I needed to uncomment originally looked like this (ellipses means lots of lines between things):

...<br />#LoadModule php4_module libexec/httpd/<br />...<br />#AddModule mod_php4.c<br />...

All you need to do is remove the “#” from the beginning of each line.

The second part is to add a couple lines further down in the file. I put them right after the line AddType application/x-tar .tgz, but you could just add them to the bottom of the file. I added this whole block, but only the last two lines matter:

#<br /># Enable the use of the PHP4 module (not part of the Apache <br /># distribution - see<br />#<br />AddType application/x-httpd-php .html .htm .php .php3<br />AddType application/x-httpd-php-source .phps

Note that this will activate PHP parsing in all files that end with any of the four extensions above, which includes regular HTML files. You might not want this, but I certainly do. It lets me use the ubiquitous .html extension for all of my files, static and programmatic. This way, if I change from, say, PHP to JSP, I don’t have to rename all the files on my server.

To make the changes take effect, you need to restart Apache; the simplest way is to go to the Sharing system preference panel, and stop and start Personal Web Sharing.

Restore or properly set up the php.ini configuration file for PHP

PHP, like a great many Unix tools, has multiple ways to configure it. At the most basic level, there are defaults that are built into the software by the programmer. Then there are “flags” you can configure the software with before you compile it; these can replace the default settings the developer created. You can also “pass in” new settings, via command line options — all that extra gobbledygook you see in those long Unix commands. And then there’s the easiest way to work with normally, the configuration file.

Like Apache, PHP has a configuration file. Unlike Apache on Mac OS X, there’s no default configuration file for the version of PHP which Apple includes in Mac OS X, including Jaguar. (I would imagine the reason is mostly marketing, like the lack of MySQL in Mac OS X client; it makes the Server version more “server-like”.)

And the fact is, most people don’t need this configuration file; the defaults in PHP are all very reasonable, and you’re less likely to need to muck with it than you are with Apache. (Even when I was programming in PHP every day, I needed to fiddle with the Apache configuration file 10 times more often than the PHP configuration file on my Unix server.)

In my case, though, the way I compiled MySQL originally, the “socket” where MySQL was “listening” for connections locally (on the same machine) was different from the PHP default “socket” where PHP would try to talk to MySQL. Basically, PHP had one telephone number for MySQL, and MySQL had changed numbers to a new location. Which meant that by default they couldn’t connect to each other. My php.ini configuration file, located at /usr/lib/local/php.ini, corrected this, but it got archived. So I needed to move it back. This required administrator privileges, which made it easier to do on the command line. In Terminal (this is one line, even if it’s wrapped in your browser):

% sudo cp /Previous\ Systems/Previous\ System\ 1/usr/lib/php.ini /usr/lib/php.ini

Note: You may need to change the name of the second directory to have the right number for your system archive (“1” in the example), if you’ve done the Archive and Install upgrade more than once.

You will be prompted for your Administrator password, required to perform the operation because the /usr/lib is a protected directory.

If for some reason you don’t have an archived php.ini configuration file, but now need one, the normal way to get it would be to download and unarchive the entire PHP source code, and locate the one file you need. Kind of a pain in the ass. In case you’re in that situation, I’ve made available two php.ini files, with my changes applied to move the socket to the right place. Download link below.

Restore user-level configuration files

Every user on a Mac OS X system (like on many other Unix systems) has a special folder in their home directory. On Mac OS X, that folder is named “Sites”, and everything in it is served up at the URL http://your-server-name/~username/, where “username” is the short login for the user (you can also use http://localhost/~username/ as a shortcut to your server, if your web browser and web server are on the same machine). This is each user’s personal web site (Personal Web Sharing needs to be turned on for anyone to see it).

Mac OS X is set up, out of the box, to allow each user to tweak the behavior of Apache when serving their own site. The very last line of the Mac OS X Apache configuration file does something kind of magic. It’s an “include” command, which is able to read in other files, and Apache treats the commands in those files as if they were in the Apache configuration file itself. But what’s particularly interesting about the command, in the Mac OS X version of the file, is it includes a whole directory. This will read in any and every file in that directory.

The purpose of this is to give each user on the Mac OS X system a mechanism for altering the behavior of Apache when sharing their part of the web site. Each user writes a few Apache configuration commands, and saves them in a file in /etc/httpd/users. Apache reads them in and uses them.

Most people don’t need to do this. It’s far-out enough to be editing the main Apache configuration file! However, for my weblog I needed to change the way Apache treated files slightly, to make the URLs to my blog prettier (and, not coincidentally, more search engine-friendly). But I didn’t want to change the behavior everywhere, just for my site. So I had my custom configuration file, /etc/httpd/users/<i>username</i>, which gave Apache the necessary instructions.

You guessed it, another item that got archived during my upgrade. Once again, the command line is the easiest way to fix this. In Terminal (this is one line, even if wrapped in your browser):

% sudo cp /Previous\ Systems/Previous\ System\ 1/etc/httpd/users/<i>username</i> /etc/httpd/users

Note: You will need to use your actual username in the command, not the string “username”. You may also need to change the name of the second directory to have the right number for your system archive (“1” in the example), if you’ve done the Archive and Install upgrade more than once.

You will be prompted for your Administrator password, required to perform the operation, because the /usr/lib is a protected directory.

Wow, that’s a lot of ground in the last couple days! Tomorrow I’ll write up a few last odds and ends about my upgrade process, and do some wrap up.
Jaguar Upgrade: Post-Install Unix Stuff, Part I
San Bei Ji : Enable PHP on Mac OS X
PHP Configuration Files
BareBones BBEdit
The Apache Project

{ Comments on this entry are closed }

The Cat that Barfed the Copper Pennies

August 24, 2002

I just ran into Cecil, our oldest cat, in the hallway. He was standing, staring at a penny right in front of him on the floor. There was a second penny just to the side. I asked him, “Are you eating those, or barfing them up?” He just looked at me.

Read the full article →

Hello, MacDevCenter visitors!

August 23, 2002

Um, gulp! These little postings have been put on the front page of O’Reilly’s MacDevCenter, one of the premier technical news sites for Mac OS X. I can see the results in my Apache logs as I type this! Hello, MacDevCenter visitors!

Read the full article →

Jaguar Upgrade: Post-Install Setup

August 22, 2002

This is the fourth in a series of posts I’m writing about my upgrade to Mac OS X 10.2 “Jaguar”. This article describes many of the post-installation tasks I went through to get back to full operation.

Read the full article →

Jaguar Upgrade: Post-Install Unix Stuff, Part I

August 22, 2002

This is the fifth in a series of posts I’m writing about my upgrade to Mac OS X 10.2 “Jaguar”. This article describes much of the post-installation work I had to do to get working again the many Unix tools and applications I have installed.

Read the full article →