Friday, 23 June 2006

Setting your shell in Mac OS X

I thought I would note to the readers that setting your shell is not as simple as editing /etc/passwd on Mac OS X.

While /etc/passwd exists on Mac OS X, it is not consulted, normally; I cite the file comments:

# Note that this file is consulted when the system is running in single-user
# mode.  At other times this information is handled by one or more of:
# lookupd DirectoryServices  
# By default, lookupd gets information from NetInfo, so this file will 
# not be consulted unless you have changed lookupd's configuration.
# This file is used while in single user mode.

’nough said.

So, you have to set your shell, as an Admin user, in /Applications/Utilities/NetInfo Manager.

Posted by caffeinated at 10:42 AM in kaffehaus

Geek notes

ZSH on Mac OS X

You might recall that I’m making a switch to zsh.

Its going swimmingly, though I find myself envoking tcsh often only because my zsh rc files are not as mature as my tcsh rc files. Okay, my zsh rc files are almost empty, but that’s not what this is about.

Mac OS X provides the zsh, but nothing in etc for system wide initialization. Where to start, then?

Linux. Fedora Core 5. Or any BSD heritage OS with zsh will probably do. I just scp’d my FC5 etc/zsh* files to my Mac, and I was off, enjoying immediately some defaults of zsh.

Correcting my domain name misspelling

The touch points for this were many, but implementation was straightforward.

The most significant hurdle was testing. I wanted to continue answering requests on the old, misspelled name so I went with a combination of ServerAlias and mod_rewrite. My virtual host looks something like:

<VirtualHost ###.###.###.###:80>
    # real name
    # other names including misspelled domain
    DocumentRoot /path/to/document/root

   #some logging options

    <Directory "/path/to/document/root">
        # some options

     <IfModule mod_rewrite.c>
        RewriteEngine on
        # test the HOST name for the misspelling then rewrite and redirect
        # pretty basic stuff right out of the Apache manual for mod_rewrite
        RewriteCond %{HTTP_HOST} ^(www\.)?anothercaffeniatedday\.com [NC]
        RewriteRule ^/(.*)$1 [L,R]

    #some mod_jk options


All of this of course requires the proper DNS settings too; left as an exercise for the reader…but if your reading this, you probably have a good understanding of what that requires.

Posted by caffeinated at 9:24 AM in kaffehaus
« June »