Mac OS X Server: iChat Service Re-inititialization

If there’s ever trouble with iChat server and ServerAdmin doesn’t let you do anything, you can fix things up based on this Apple Support article:

This can occur if the /Library/Preferences/ichatserver.plist file has been deleted or is problematic. If the com.apple.ichatserver.plist file is deleted a new default version of this plist will be created.

$ sudo /usr/libexec/PlistBuddy -c "Set :initialized true" /Library/Preferences/com.apple.ichatserver.plist

Refresh the Server Admin view for the iChat service. The Start button should now appear and the service should be configurable.

You can reset the iChat database with (you should make sure you have a backup!):

$ sudo rm -rf /private/var/jabberd/sqlite
$ sudo /usr/libexec/ichatserver_init_tool -i

iPhone and Snow Leopard Server’s failure to communicate

A few months ago I was complaining about not being able to synch my iPhone with Snow Leopard Server. Today, I realized that email push wasn’t working either!
This ARS Technica article iPhone and Snow Leopard Server’s failure to communicate provides more detail.

Imagine if the iPod worked with a Windows machine but not on a Mac. Would make zero sense, right? Amazingly, this scenario describes the current reality with the iPhone and Apple’s server edition of its Mac OS X operating system. Mac OS X Server has some great features, such as podcast production and collaborative wikis. But from the perspective of iPhone compatibility, it’s one of the worst server OSes available.

This ZDNet Snow Leopard Server review mentions the same problem:

For example, Apple told us that the new Mail 2 server software supports push notification to iPhones. But we couldn’t get this working in our lab tests. This Apple document describes push email support on the iPhone but does not include Mail 2 push configuration.

Installing apache on Mac OS X

I’ve got Leopard (10.5.1) with the developer tools installed and want to do some
more development in Django on my laptop. I first want to install MacPort to make it
easier to download and install various opensource projects. Using MacPorts, I’ll
get Apache
installed and configured. Finally, I’ll get the basic django working.
1. Installing Mac Ports painless. Just follow the direction at the web site. I prefered to download and install the disk image: disk image
2. You need to add port to your path. I use a ~.bashrc:

PATH=/usr/local/bin:/usr/X11R6/bin:/opt/local/bin:/opt/local/sbin:$PATH
    

and make sure it’s available (create a new shell, a new terminal window, or “. ~/.bashrc”). The command

bport -h/b
Usage: port
        [-bcdfiknopqRstuvx] [-D portdir] [-F cmdfile] action [privopts] [actionflags]
        [[portname|pseudo-portname|port-url] [@version] [+-variant]... [option=value]...]...
"port help" or "man 1 port" for more information.
    

should print a help message.
3. I checked to make sure which apache and any options I could chose from (the “sudo” is so I can run the command as root (administrative user) and I do it each time so I have a log of my actions)

$ sudo port selfupdate
MacPorts base version 1.600 installed
Downloaded MacPorts base version 1.600
The MacPorts installation is not outdated and so was not updated
selfupdate done!
$ sudo port list apache
apache                         @1.3.37         www/apache
macbook:~ ware$ sudo port list apache2
apache2                        @2.2.6          www/apache2
$ sudo port variants apache
apache has the variants:
	universal
	darwin
	apache_layout

And finally, let’s install it:

$ sudo port install apache2

Shockingly, there was an error:

...
checking for mawk... (cached) no
checking for gawk... (cached) no
checking for nawk... (cached) no
checking for awk... (cached) no
configure: error: No awk program found
  

I think there was a path problem involved because gawk was now installed and restarting the install worked:

$ sudo port install gawk
Skipping org.macports.activate (gawk ) since this port is already active
$ sudo port install apache2
  

I now need to tell OS X about starting up this application on system booting:

$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
  

And now it’s time to configure apache:

$ cd /opt/local/apache2/conf
$ cp httpd.conf.sample httpd.conf
   

Trying to start it apache up gave me this error:

$ sudo /opt/local/apache2/bin/apachectl start
httpd: Syntax error on line 96 of /opt/local/apache2/conf/httpd.conf: Cannot load /opt/local/apache2/modules/mod_ssl.so into server: dlopen(/opt/local/apache2/modules/mod_ssl.so, 10): Symbol not found: _ssl_cmd_SSLCACertificateFilen  Referenced from: /opt/local/apache2/modules/mod_ssl.son  Expected in: flat namespacen
   

Use your favorite editor to comment out ssl (I don’t need it, yet)

$ sudo vi httpd.conf
...
#LoadModule ssl_module modules/mod_ssl.so
...

3. Start it up:

$ sudo /opt/local/apache2/bin/apachectl start
$ sudo bin/apachectl start
 

4. And prove it works by connecting to http://localhost/