Setting up the OS X Server

Fairly straightforward initial Mac installation. Under SystemPreferences/Network I set the initial IP config to be via DHCP. For the Facility machine I need to switch it to a static IP, for the other machines I've left it as DHCP. Initial naming for the Facility machine was xray_facility, somewhat arbitrary. In Unix space it's referred to as xray0.

I disabled most of the power saving features (e.g. spinning down the hard drive) but left the screen saver active.

Installing software: I let the machine switch between OS X and Classic (OS 9.2) trivially, depending on how it wanted to launch the installer. I put obvious OS 9 applications into the folder "Applications (OS 9)" and the rest in the "Applications" folder. The standard apps loaded are Photoshop 5, Photoshop 7 and Canvas 8.

Unix Applications

Most of the following is taken from Bill Scott's Crystallography on OS X web pages. I registered with the Darwin source code project site - but this probably isn't important.

1. X Windows

Download Apple's X-windows programs (v. 0.3, March 17 2003 release) from here (about 42 MB download) and additional libraries here (SDK, 3.8 MB Download, bottom right corner of page).;(New release fixed bug when using hklview.)

Set the display to let you run X-windows applications from your non-X terminal windows by putting this in your .cshrc or equivalent:

if (!  $?DISPLAY) then	
    setenv DISPLAY :0.0
endif
I also changed a couple of default settings:
defaults write com.apple.x11 wm_ffm true
defaults write com.apple.x11 no_quit_alert true

The first of these gets rid of the annoying, non-canonical click-to-focus property, and the second gets rid of a warning window that pops up and prevents you from logging out if X11 is running. man Xquartz for more information and other possibilities.

Note that you don't want/need to run the OrborOS window manager if you are running this Apple Xserver.

2. Developer Tools

Apple makes a native c compiler that comes with the Apple Developer Tools. For OS 10.2, it is the gcc compiler version 3.1, tweaked a bit apparently for the Mac operating system. (You also get a copy of version 2.95, and can switch between them if you need to. man cc for details. Can't see why you'd want to.) You can either get it on the OS X distribution CDs, which are out of date unless they were produced as recently as the end of December, 2002, or you can download it from Apple's site. In order to do the latter, you have to join their developer group, which is free but involves submitting a tedious form, getting a username and password, etc. You can spend a lot of time going in circles; this site is a pain to navegate.

Phil has the Dev stuff on a burnt CD, for convenience.

3. Fink - installed 3rd party software

1. Install the Fink binary installer, following steps 1, 2 and 3 described on their quickstart page. a. Download the installer disk image: Fink 0.5.1 Binary Installer (10.1 users - use Fink 0.4.1)
b. Double-click "Fink-0.5.1-Installer.dmg" to mount the disk image, then double-click the "Fink 0.5.1 Installer.pkg" package inside. Follow the instructions on screen.
c. Open a new Terminal.app window and type "pico .cshrc". A text editor will pop up. Enter this line:
source /sw/bin/init.csh

2. Configure fink to use cvs releases:

% fink selfupdate-cvs

% sudo apt-get update
3. Tell fink where you have installed X-windows:
% fink install system-xfree86
4. Use the command % fink list to see what is available.

5. Use the command

% sudo apt-get install  packagename
to install binaries from Debian packages prepared by fink. These are not available in all cases, so if apt-get reports that it is not found, or if you want to compile stuff yourself, instruct fink to do so with
% fink install  packagename
6. Some packages are only available currently from the "unstable" branch (eg: mozilla, scientificpython). Copy the appropriate files to your fink installation and then install. I've rounded these up for you along with some automated crystallography install scripts here. Beware that these may not be current. You are better off doing it yourself. However if you install an old one, next time you do a fink update-all, it will make everything current.

Fink installs programs into machine-wide locations under /sw, so can be useful to build a general default installation. This is Phil's list of Fink commands/installs as of March 2003:

fink scanpackages
fink selfupdate-cvs
sudo apt-get update
# Inform Fink that we already have X installed
fink install system-xfree86
fink list
sudo apt-get install g77
sudo apt-get install f2c
sudo apt-get install fort77
sudo apt-get install fftw
sudo apt-get install tcltk
sudo apt-get install blt
# Mozilla appears broken in both FINK and APT-GET
# sudo apt-get install mozilla
fink install scientificpython
fink install povray
fink install xv
sudo apt-get install xemacs
fink install rasmol
sudo apt-get install ghostscript
sudo apt-get install imagemagick
sudo apt-get install ispell
sudo apt-get install openssh
sudo apt-get install xtraceroute
sudo apt-get install xforms
sudo apt-get install nedit
sudo apt-get install openmotif3
sudo apt-get install pymol
Note that you can get applications like Mozilla, Netscape etc in the normal download/install way in the Mac. They just install in different places.

You can also install the same software in more Unix-traditional locations, but which version you will use depends on the relative position of /sw and the other locations within your PATH variable.

4. Software Installation

OS X automatically launches Classic (OS 9.2) if you try and launch OS 9-based installers. Generally, place OS X applications in the regular Applications directory and put OS 9 apps in the "Applications (Mac OS 9)" directory.

Some installations, particularly those for Microsoft Office, Eudora and Endnote are simply drag it into the applications folder.

Magic fix for Endnote for Microsoft Word: find the "cite while you write" folder in the Endnote directory, and drag it into Microsoft:Microsoft Office X:Office:Startup:Word directory (: is the folder separator). Start Microsoft Word. Go into preferences, under file locations, select startup. Hit the Modify button, and use the file browser to single-click your way through the directory tree until you have selected the new location of the "cite while you write" folder in ....Startup:Word. Hit the Choose button. Quit Word and restart it and you should see the Endnote menu within the Tools menu in Word.

DAVE configuration: make sure that Windows File Sharing is off in the Sharing control panel. The domain is MSKCC. The account name and password are as specified on the PCs.

Adding hosts via NETINFO: create yourself a HOSTS file from one of the SGI/LINUX files using:

grep 140.163.179.2 /etc/hosts > HOSTS
and copy it somehow to your G4 box (e.g. cut and paste into a editor window). Then, save the current contents of the netinfo machine "directory":
% nidump -r /machines / > machines.original
% cat machines.original 
then merge the contents of the HOSTS flat file that you've just created
% sudo niload -v hosts / < HOSTS 
and check your entries
% nidump -r /machines /
This approach was culled from this article which was actually more to do with suppressing popup ads (by lying about the IP addresses of notorious popup ad servers).

This is the current (Mar 2003) contents of my HOSTS flat file:

140.163.179.201 hhmipc1
140.163.179.202 xtreme1 xtreme1-fast xtreme1.ski.mskcc.org xtreme1.mskcc.org
140.163.179.203 xtreme2 xtreme2-fast xtreme2.ski.mskcc.org xtreme2.mskcc.org
140.163.179.204 xtreme3 xtreme3-fast xtreme3.ski.mskcc.org xtreme3.mskcc.org
140.163.179.205 xtreme4 xtreme4-fast xtreme4.ski.mskcc.org xtreme4.mskcc.org
140.163.179.206 xtreme5 xtreme5-fast xtreme5.ski.mskcc.org xtreme5.mskcc.org
140.163.179.207 xtreme6 xtreme6-fast xtreme6.ski.mskcc.org xtreme6.mskcc.org
140.163.179.208 xray1   xray1.ski.mskcc.org
140.163.179.209 xray2 xray2.ski.mskcc.org xray2.mskcc.org
140.163.179.210 xray3 xray3.ski.mskcc.org xray3.mskcc.org
140.163.179.211 ximpact1 ximpact1-fast ximpact1.mskcc.org ximpact1.ski.mskcc.org
140.163.179.212 ximpact2 ximpact2-fast ximpact2.ski.mskcc.org ximpact2.mskcc.org
140.163.179.213 ximpact3 ximpact3.ski.mskcc.org ximpact3.mskcc.org
140.163.179.214 ximpact4 ximpact4.ski.mskcc.org ximpact4.mskcc.org
140.163.179.215 nppmac
140.163.179.216 xray4   xray4.ski.mskcc.org 
140.163.179.217 xray5   xray5.ski.mskcc.org
140.163.179.218 xray6   xray6.ski.mskcc.org
140.163.179.219 xray7   xray7.ski.mskcc.org
140.163.179.220 xray8   xray8.ski.mskcc.org
140.163.179.221 xray9   xray9.ski.mskcc.org
140.163.179.222 xlaptop1        xlaptop1.ski.mskcc.org
140.163.179.223 xlaptop2        xlaptop2.ski.mskcc.org
140.163.179.224 xray0        xray0.ski.mskcc.org
and this seemed to load OK. Once it is loaded, commands like "telnet xray2" work as expected.

Adding NFS mounts via NETINFO: read this to make your G4 an NFS client, or this article to run an NFS server. Running an NFS server seems a little pointless if you enable file sharing, frankly, unless you want your G4 to strictly impersonate one of my SGI or Linux installations. NFS mounts are not going to be viable with variable-IP G4's (i.e. ones with DHCP settings), because of the security restrictions I use when defining NFS exports.

Tips, tricks and Random Ideas

If the only administrator account forgets their password, look at this link to work out the solution. Specifically, boot using the OS X operating system CD, and pull down the Installer menu and select Reset password, type the new password and hit Save just once. If you hit save more than once it seems to overwrite your new password.

This document gives a simple primer as to the use of Netinfo instead of traditional Unix flat files in /etc for system administration (/etc/hosts, /etc/fstab, /etc/exports etc). Netinfo is somewhat of a badly-documented nightmare, however.

OS X login via SSH

ssh, scp, and sftp are the secure versions of the Unix utilities rsh, rcp and ftp. Whereas automatic usage of rsh and rcp is controlled by the file .rhosts, and ftp via .netrc, the ssh procedure is slightly more cumbersome. What you have to generate is a key, and then propagate this key to the machine you want to auto-login to:

On the host, one generates the key-pair using:

ssh-keygen -d
and then just propagate it to the destination machine:
ssh xray0 mkdir .ssh
ssh xray0 chown go-rwx .ssh
scp ~/.ssh/id_dsa.pub xray0:.ssh/authorized_keys2
Really only the last command is necessary, but if the .ssh directory does not exist you might need to create it. After the keys are in place, you shouldn't need to supply passwords for future transactions.