Mac OS X ~/Library Permissions

Note to future self: the next time you re-install Mac OS X from scratch, remember that the reason why PHP cannot access include files in your ~/Library/WebServer folder is because the permissions on the ~/Library directory forbid read access to all but owner.

Before I explain the problem and solution that had me tearing my hair out Friday through Sunday, let me explain how I organize my system for doing PHP development and serving. Mac OS X Jaguar includes robust web serving capabilities, in the form of Apache and PHP. Apache’s default services, the documents and CGIs which are installed with Jaguar, are located in subdirectories under /Library/WebServer. This would be a natural place to put configuration and include files for PHP, and indeed it is where I keep the server-wide php.ini configuration file for PHP, /Library/WebServer/PHP/php.ini.

(I also create a symlink for that file at /usr/local/lib/php.ini, because that’s where Marc Liyanage’s full-featured PHP module, which I install over Apple’s “lite” version, expects to find its configuration file.)

However, Mac OS X separates out very cleanly the functionality installed at the system level, for all users, and functionality installed for a specific user. System level items go into /Library, while user-specific items go into ~/Library (that is, the Library folder in your home folder). The two directories mirror each other in structure, but have a different “scope” — system-wide versus user-specific. Since I was adding my blogging system’s PHP libraries for my own use only, I created the ~/Library/WebServer directory, and a PHP/Includes subdirectory under it, to hold them:

/Users/username/Library/WebServer/PHP/Includes/monauraljerk

I add the following line to my /private/etc/httpd/users/username.conf to make PHP look for include files in the above Includes folder:

path "/Users/username/Library/WebServer/PHP/Includes:/Library/WebServer/PHP/Includes"

This needs to go inside a VirtualHost or Directory statement; if you don’t know what those are, you might not want to be fiddling with this stuff.

The problem was, whenever I would load a PHP page that tried to include() one of the PHP libraries, or any file stored in my private Includes folder, it would fail with a “file not found” error. I spent more than 6 hours trying to track this problem down, finally resorting to brute force PHP scripts to test file_exists() on a bunch of different files, until I located the issue (and was able to blog once more!).

So, finally, here’s my point. Note to future self: the next time you re-install Mac OS X from scratch, remember that the reason why PHP cannot access include files in your ~/Library/WebServer folder is because the permissions on the ~/Library directory forbid read access to all but owner. You need to increase the permissions like this:

chmod go+r ~/Library

Remember it!

Mac OS X System Migration

As part of my hard disk replacement, I decided to do a complete reinstall of the operating system for my Mac G4. This is different from the Archive & Install project I undertook last year, I actually installed Mac OS X 10.2 onto an erased hard disk, created my account from scratch, and have been re-installing all my software, and copying over settings and documents as I need them.

As part of my hard disk replacement, I decided to do a complete reinstall of the operating system for my Mac G4. This is different from the Archive & Install project I undertook last year with the release of Mac OS X Jaguar. In this case I’m taking the most extreme approach, I actually installed Mac OS X 10.2 onto an erased hard disk, created my account from scratch, and have been re-installing all my software, and copying over settings and documents as I need them.

I am specifically not copying over my Users directory entire, because I want to leave behind all the cruft that has built up on my original installation, now more than two years old. I’ve installed so much software, some of which I now consider unsafe (Norton SystemWorks, for example), and some of which has become unnecessary, that it’s impossible to “undo” the changes they’ve wrought. The only way to get away is a completely clean installation, and deliberate installation of tools I actually use or need.

Of course, the downside is I lose much of the hundreds of hours that I’ve put into tweaking my system. Redoing the important stuff is a huge enough task that you have to ask, if it ain’t broke, why fix it?

The thing is, some things are broke. I have a downloads folder where all the items jump around in icon view, and the window shifts the scroll positions whenever I unmount a disk image. Weird stuff, that’s more annoying than a real problem. But because it’s unexplainable, and impossible to eliminate (and lord knows I’ve tried), it makes me worry about overall system correctness.

Anyway, I’m taking a similar approach as the one I took when I first migrated from Mac OS 9 to Mac OS X: move my e-mail and web browsing to the new system. Everything else will follow.

It’s amazing, but those are my most constant, most important activities. Once those are migrated, there’s no going back, so I may as well head forward. There’s quite a bit still in front of me, so I’m sure I’ll post more on this topic as I run across helpful tips or interesting lessons.

DHI 99-101

Daily Home Improvements: Lock outs, the Terminator, and the Great Migration.

DHI 99: I changed the locks on our front and back doors, in preparation for terminating our housecleaner. Sadly, it’s necessary. To make matters worse, I forgot to really look at the front door lock in-place. It’s older and unusual, in that it’s a deadbolt that integrates with the regular door handle. When I got back from the rekeying, I could not figure out how to put it back together quite the way it was…

DHI 100: It’s sad that this particular milestone was letting our housecleaner go. Unfortunately we had an ugly, ugly tax surprise this year, and cutting back on expenses became rapidly more important than the convenience of having someone clean up after us.

DHI 101: I didn’t record any additional distinct DHIs this week, because my access to my weblog was cut off due to my system migration. I did actually do some things, but I find that if I don’t write them down quickly, I forget them. All I can remember from this week is the work I did on re-installing Mac OS X, and migrating over my applications and system settings, etc., which I’m recording as a single DHI, though it’s been quite a bit of work, and I’m maybe halfway finished.

The Sound of Silence

Two weeks ago I installed a new $80 hard disk drive in my computer, to replace a much more expensive SCSI disk that makes too damn much noise. Last weekend I made the switch, and turned off the SCSI disk, possibly forever. The difference in noise is remarkable, to the point of being eerie.

Two weeks ago I installed a new hard disk in my Mac G4, a 75 gig IDE disk, to complement the 70 gig SCSI hard disk that came with the computer when I bought it. The SCSI disk is an ultra-high performance hard drive, running at a much higher rotation speed and connected to a dedicated high-performance interface card. The disk and card added $1,100 to the cost of the system, and for speed it (theoretically) blows the doors off the IDE drive.

It’s also incredibly noisy.

It’s a high-pitched whine, and when the disk is on, it pervades the office, penetrates the brain, and drives me nuts. Then when the disk is active, when I’m downloading or running scanning activities, it audibly chirrs and chatters away. It’s by far the noisiest device in the office. Ah, the price of speed.

So I bought the relatively slow IDE disk, for $80, because it is one of the disks with fluid dynamic bearings, and runs nearly silent. My intent was to transfer my entire installation from the SCSI disk to the IDE drive, and disconnect the SCSI disk, hoping to reduce the overall noise level to something bearable.

Last weekend I did exactly that. When I shut down the machine to disconnect the power cable from the SCSI disk, I took a moment to savor the noise my computer makes when it powers down to quiescence (my system normally runs full-time, 24/7; I never turn it off except for maintenance). The SCSI disk makes this slowly trailing off whine, like a jet turbine shutting down. When it finished, the office was eerily quiet.

When I booted back up, the G4 was not entirely silent. The power supply and chassis fans all make some noise, which was hard to notice before, over the whine of the SCSI disk.

The weirdest thing for me was that disk activity is unnoticeable. Booting and during other disk-intensive activities, I could previously hear the disk quite distinctly, and it gave me feedback that the task was making progress. The new disk is completely inaudible over the (fairly quiet) fan noise, and gives me zero clues that anything is happening at all. It’s great, but I find it interesting that I actually depended on the unpleasant disk noise to know that things were running normally.

Guess I’ll have to get used to it. :-)

DHI 78-80

Daily Home Improvements: hardware upgrades, scraping up crap, and for sale!, a 19″ Trinitron monitor!

DHI 78: I installed more RAM and another hard disk into my Mac. The RAM was especially needed, because I was getting huge numbers of swap files on my system during regular use, and every once in a while would get stuck in VM swapping. Painful, but seems to be solved now. The extra hard disk is so that I can enable software mirroring for my main drive, to protect against disk crashes. If you’ve ever lost a hard disk to mechanical or other catastrophic failure, you know that an extra $100 to prevent it is more than worth it.

DHI 79: I used a paint scraper to scrape up some gunk from our bedroom doorjamb, which has been there for months, and occasionally driving me nuts that our house cleaner was not seeing and getting rid of. It took all of 30 seconds, once I had the tool. While I was at it, I scraped up a couple paint drippings from the floor in the water closet.

DHI 80: I just listed one of my 19″ Sony Trinitron monitors on Craigslist.org, for $75. It will be nice to get this thing out of the house!

DHI 34-40

Mucking about in Mac OS X, fun with water, more gas, desktop action, FM broadcasting, curtains for Rochelle, and a party!

DHI 34: I updated software on my Mac, on a second hard disk that I’ll transition to, once I get all my stuff moved over. I did a small part of it today. Pretty lame, but sustaining a daily pace for these tasks is turning out to be a killing pace. Plus, when I get finished, I’ll be able to disconnect the very noisy hard disk in my Mac, making the office quieter, which will be a major improvement.

DHI 35: We had the missing gas line replaced yesterday, providing gas to our groovy vintage heater once again. But, the alterations to the gas lines required cutting off the gas for an extended amount of time, and blowing out the gas lines. Once hooked back up, our contractor re-lit the pilot light, but there was air in the lines, which caused the pilot light to go out on our hot water heater. In the middle of the night. Cold bath the next day. It took quite a bit of figuring to realize that it was air in the lines that caused it to go out, and make it hard to re-light, but I did eventually get the pilot re-lit.

DHI 36: While the hot water heater contained cold water, I drained it, to get the silt and stuff out of the bottom. Apparently you’re supposed to do this a couple times a year. So I did it.

DHI 37: Cleared off one side of my desk of the crap piled up there. The other side will be harder, a weekend DHI for sure.

DHI 38: I hooked up a $4 antenna to the stereo in the front of the house, so now we can listen to the radio when we’re in the office working on the computer. Or, hey, maybe someday we’ll have another party, and people can sit in the parlor, and, like, hear music!

DHI 39: I helped Rochelle hang curtains that our decorator picked up for us. We had to replace the old curtain rods, which were far too flimsy to support the heavier velvet curtains he picked out, so that was most of the work. It would have gone a lot faster, but both batteries for our cordless drill were dead.

DHI 40: We threw a small party at our house, our first in nearly a year. (We plan to do better in 2003 than we did in 2002.) This was a small gathering (10 people) with a focus on tasting fine champagne (more on this in a post tomorrow). Of course, there was a lot of cleanup and so on beforehand, but the DHI is really for inviting people into our house and making sure they had a good time. That’s a home improvement, in any sense of those words.

DHI 13-19

BeBoxes, software updates, configuration fixes, more clearing of shelves, meta tags, meetings with designers, more fun with gas, clearing a flat surface, and over a dozen t-shirts bite the dust.

DHI 13: I worked on the BeBoxes, installing permanent RAM in the dual 133 that I plan to keep. Installed a network card too, but the Kingston card I tried isn’t working, not sure why. Might be tomorrow’s DHI — with my BeBox deadline fast approaching, that’s all I really have time for.

DHI 14: I updated my Mac to OS X 10.2.3, and ran the Repair Privileges tool on it, which corrected a few errors.

(Mac OS X tip: It’s always a good idea to do this after installing an OS update, or really, any installer that asked for the administrator password. You can run this without rebooting, or booting from a CD. Just run /Applications/Utilities/Disk Utility, and do a Repair Permissions on your boot disk. Works fine, and catches errors.)

I also found and fixed an error in our MIMEDefang configuration file, which may have been causing us to lose mail since the 5th (yikes!). So if you wrote to us and didn’t get a reply, try again!

DHI 15: I worked on the bookshelves again, selecting more books to be pass on to another household. I pulled out enough books, both paperback and hardback, to get all the other books that I didn’t have room for onto the shelves proper, instead of sitting casually on the edges.

I also installed MovableType, a different weblogging package, for Rochelle to try out on her weblog…if I can get her to start one!

DHI 16: This one’s kind of geeky (even more so than usual). I added my ICBM Address (latitude and longitude) to my blog page and registered with GeoURL. Now you can see what other web sites are near me physically.

DHI 17: Rochelle and I met with an interior designer for about two hours, to start the process of getting help to finish the water closet project we began almost two years ago.

Rochelle also got someone to come over and hook up the gas heater we’d worked on so hard previously. But that’s a whole other story.

DHI 18: I got rid of almost 20 old t-shirts from my dresser. I kept most of the Be t-shirts, though; I still can’t bear to part with them…

DHI 19: I cleared off my nightstand, throwing some stuff out, and getting rid of a pile of crap I was pretending I would eventually read. With a clear nightstand, I can now hook up my alarm clock and actually use it, a big improvement from Rochelle and I passing back and forth a little travel alarm (the person getting up earliest got the alarm).

I should add that Rochelle blew me out of the water this week, with less than two hours of work on the back deck. It looks fabulous, and it’s now worthy of having people over and hanging out on the deck. Woo hoo!

Making News Aggregators Easy

The time has come to make using news aggregators easy, Mac OS-style. Every browser should have a “Subscribe to this Site” command, which should send a standardized subscribe message to the user’s preferred news aggregator, which would use RSS auto-discovery to subscribe the user to the news feed. Could it be that simple?

The time has come to make using news aggregators easy, Mac OS-style. Every browser should have a “Subscribe to this Site” command, which should send a standardized subscribe_rss AppleEvent (or similar message on other OSes) to the user’s preferred news aggregator, which would use RSS auto-discovery to subscribe the user to the news feed.

This is a suggestion for Chimera, Safari, and other Mac OS X browsers to have a menu command “Subscribe to this Site” (I’m sure there are better words), and a corresponding toolbar button.

This is also a suggestion for Mac OS X to have a new standard Internet application category, of news aggregator, that the user would select in the system preferences. I think it would deserve its own tab, News, in the Internet preferences panel. (This could also be combined with Usenet reader prefs, I suppose, though that’s not my focus here.)

Aside: A promotion to a standard internet tool would require that Mac OS X include a news aggregation application in the distribution. I imagine there are a few third-party developers who could help out here (Ranchero and UserLand come to mind).

This is also a request for all the Mac OS news aggregator application developers to work together to design the right AppleEvent; that ought to be pretty simple. (It might even already exist…?)

Why is this a good idea? Here’s the Before & After user scenario:

Before Subscribe RSS support:

  • User finds an interesting news site or weblog, and decides they’d like to read it regularly.
  • User hunts on web page for a “RSS” or “XML” logo, or other subscription button or link (different for every site).
  • User (hopefully) finds link, right-clicks “copy link to clipboard”.
  • User switches to preferred news aggregator application.
  • User selects the Subscribe to New Site command (different for every aggregator).
  • User pastes in URL copied to clipboard.
  • User clicks Subscribe button.
  • User (hopefully) gets confirmation page/screen that they have successfully subscribed.

(Brent, apologies, I know NetNewsWire makes it a little easier, but I’m still using Radio right now.)

(Dave, apologies, I know that Radio has the slick coffee cup icon approach to subscription, but it’s Radio-specific (for both user and site author), not a general approach.)

After Subscribe RSS support:

  • User finds an interesting news site or weblog, and decides they’d like to like to read it regularly.
  • User clicks the “Subscribe to this Site” button on browser toolbar.
  • System switches the user to their preferred news aggregator application.
  • User (probably) gets confirmation page/screen.

A lot fewer steps, and all of them are simpler (except #1, the eternal dilemma of the Internet).

This is an opportunity for leadership from browser authors, especially Apple, to really leverage the weblog and news aggregation waves. I frankly find my news aggregator more important to my “digital life” than my camera, DVD drive, or even iTunes. This kind of usability could make news aggregation a part of everyone’s mother’s lives.

LazyWeb, take me away!

Keynote

I just finished installing my new copy of Keynote, Apple’s new presentation program. It’s _so beautiful,_ I am imagining that I will borrow a Mac to be able to give a presentation using Keynote during our sales kickoff, next week.

I just finished installing my new copy of Keynote, Apple’s new presentation program, and spent a few minutes playing around with it. It’s so beautiful, I am imagining that I will borrow a Mac to be able to give a presentation using Keynote during our sales kickoff, next week.

But then I look through the available presentation themes…and none of them are professional in the way I’d like to present to the sales team. They are all beautiful, and they certainly have character. Indeed, that might be the problem. I want the gorgeous Quartz transitions and imaging, but I actually want to use a more “boring” theme.

The themes page says that it’s possible to create new themes using tools like Photoshop and Illustrator, and there are (somewhat brief) instructions in the manual, so this is probably a temporary issue. I hope that lots of people will buy Keynote, and that designers will create new themes for it. I might even be willing to pay for a themes pack. Might be nice if Apple offered such a thing as a reward to early Keynote buyers…

125 Million Years of Command-N

According to my rough calculations, the Mac OS X “Finder” throws away approximately 125 million person years by switching Command-N to create a new file browser window.

Formula

(# Mac Users) * (Avg. Years on Mac OS) = # of person years where “Command-N” in the Finder created a new, empty folder in the current Finder window, instead of creating a new file browser window.

Rough approximation

(25 million) * (5 years) = 125 million person years

Conclusion

The Mac OS X “Finder” throws away approximately 125 million person years by switching Command-N to create a new file browser window.

I don’t see how this is justified. There is no improvement, just change for change’s sake (or NeXT’s sake). It’s even arguable that the average Mac user creates folders more often than opening new file browser windows, which means it’s worse, even for people who are new to Macs.

This is a Bad Thing. Tell Apple.

More info on Archive and Install

Apple has published a (brief) Knowledge Base document discussing the Archive and Install feature for upgrading to Jaguar. The document’s short on details; I think you’ll find my series of articles is more informative.

Apple has published a (brief) Knowledge Base document discussing the Archive and Install feature for upgrading to Jaguar. The document’s short on details; I think you’ll find my series of articles is more informative, particularly this one.

The one new bit of information is that you won’t find this option on the Mac OS X 10.2 Upgrade CD (presumably what you get through the Mac OS Up-To-Date program for $19.95), only on the full installer CD, either the retail box version or the CDs that come with a new Mac.

Save $70 on Adobe Photoshop Elements!

I recently bought Adobe Photoshop Elements 2.0 from Amazon.com for $29. That’s right, $29. Now Amazon.com has dropped the price by $9, so you can get it for $20. Here’s how!

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 Amazon.com) 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 Amazon.com ($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 Amazon.com just dropped their regular price by $9, so now you can get Photoshop Elements for only $20!

The bad news is that Amazon.com’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.