Leopard

Just a quick note on the progression I’m making to get the mailserver components working on Leopard. At first I thought it would be simple, just recompile the lot and be done with it. But as most of you might have noticed, a lot has changed under the hood for Leopard. most notably was the removal of all the netinfo stuff and replacing it with dscl.

I’ve got the basic stuff working with some workarounds but still need to test SSL, maildrop and DSpam. But to reveal some of the stuff that needs to be done in a different here are some of the changes to be made in the documentation:

Postfix has no changes to the install instructions.

Instead of niutil to create the vmail user we use dscl:

sudo dscl . -create /Users/_vmail
sudo dscl . -create /Users/_vmail UserShell /usr/bin/false
sudo dscl . -create /Users/_vmail UniqueID 102
sudo dscl . -create /Users/_vmail PrimaryGroupID 102
sudo dscl . -create /Users/_vmail NFSHomeDirectory /var/empty
sudo dscl . -passwd /Users/_vmail ''

To compile courier-auth you need this line added to the configure fase:

export MACOSX_DEPLOYMENT_TARGET=10.5 \
./configure --with-authmysql \
--without-authpam \
--with-mysql-libs=/usr/local/mysql/lib/mysql \
--with-mysql-includes=/usr/local/mysql/include/mysql

IMAP 4.3.0 compiles without a problem, but won’t run properly yet. I’ve got IMAP 4.2.1 working without any change in how you need to compile it. Update: tried it again and it all works, my mistake! Sorry…

On to the next item on the todo list, will keep you posted on my progress.

no comments

As people are compiling Apache on Leopard and because its not the usual configure, make, install procedure. I thought a separate blog post explaining it would help people to get it all working.

There are 2 ways to define the setup, go for the default Leopard install method and overwrite the current Apache installation or install a separate instance. The separate instance falls in line with all the other DIYMacserver documentation. The Leopard install will keep the functionality of the preference pane intact. You choose !

The difference in the configuration is made in the ‘config.layout’ file which determines where all the packages should be installed. For both methods copy the layout below and add it to the ‘config.layout’ file.

DIYMacserver installation configuration
<Layout DIYMacServer>
  prefix: /usr/local/apache2
  exec_prefix: ${prefix}
  bindir: ${exec_prefix}/bin
  sbindir: ${exec_prefix}/bin
  libdir: ${exec_prefix}/lib
  libexecdir: ${exec_prefix}/modules
  mandir: ${prefix}/man
  sysconfdir: /etc/httpd
  datadir: /Library/Webserver
  installbuilddir: ${datadir}/build
  errordir: ${datadir}/error
  iconsdir: ${datadir}/icons
  htdocsdir: ${datadir}/Documents
  manualdir: ${datadir}/manual
  cgidir: ${datadir}/CGI-Executables
  includedir: ${prefix}/include
  localstatedir: /var
  runtimedir: ${localstatedir}/run
  logfiledir: ${localstatedir}/log/httpd
  proxycachedir: ${runtimedir}/proxy
</Layout>

Leopard installation configuration

<Layout Leopard>
  prefix: /usr
  exec_prefix: ${prefix}
  bindir: ${exec_prefix}/bin
  sbindir: ${exec_prefix}/sbin
  libdir: ${exec_prefix}/lib
  libexecdir: ${exec_prefix}/libexec+
  mandir: ${prefix}/share/man
  sysconfdir: /etc+
  datadir: /Library/Webserver
  installbuilddir: ${prefix}/share/httpd/build
  errordir: ${prefix}/share/httpd/error
  iconsdir: ${prefix}/share/httpd/icons
  htdocsdir: ${datadir}/Documents
  manualdir: ${datadir}/share/httpd/manual
  cgidir: ${datadir}/CGI-Executables
  includedir: ${prefix}/include+
  localstatedir: /var
  runtimedir: ${localstatedir}/run
  logfiledir: ${localstatedir}/log+
  proxycachedir: ${runtimedir}/proxy
</Layout>

If you’ve edited the ‘config.layout’ file you are ready to run the configuration script. Change the ‘–enable-layout’ to reflect your choice in configuration. So fill in either DIYMacServer or Leopard to choose, the example uses DIYMacServer as the layout.

./configure --enable-layout=DIYMacServer \
--enable-mods-shared=all \
--with-ssl=/usr \
--with-mpm=prefork \
--disable-static \
--disable-unique-id \
--disable-ipv6 \
--enable-ssl \
--enable-dav \
--enable-cache \
--enable-proxy \
--enable-shared \
--enable-logio \
--enable-deflate \
--with-included-apr \
--enable-cgi \
--enable-cgid \
--enable-suexec

You can now run:

make

and if it all goes well:

sudo make install

If you run into errors or some strange thig happens which you can’t explain, please post you questions and the error into the forum on this site:

The configuration and all the other posts related to apache in the documentation set are still valid, you still can use those.

15 comments

As I already blogged before, there where some changes in the user creation. I noticed the new notification for the mysql user which changed in Leopard into _mysql, the underscore appears on almost all the users that aren’t connected to people. The only users without an underscore are ‘daemon’, ‘nobody’, ‘root’ and me.

But more has changed I found out. As where I first used the Netinfo tools to create users for daemons to have them use it, like the vmail user for the virtual mail directory. But in Leopard these tools are gone! There is also no GUI tool to have a look at them.

There is a new tool in town, it’s called the ‘Directory Service command line utility’, ‘dscl’ for short and is command line only! See this article in the Apple knowledgebase and the dscl man page here.

Here is a example on how to use the tool which you have to use as root or use with the sudo command. To find out the UID of the postfix user you use the following command:

$ sudo dscl . -read /Users/_postfix

Which returns:

AppleMetaNodeLocation: /Local/Default
NFSHomeDirectory: /var/spool/postfix
Password: *
PrimaryGroupID: 27
RealName:
Postfix Mail Server
RecordName: _postfix postfix
RecordType: dsRecTypeStandard:Users
UniqueID: 27
UserShell: /usr/bin/false

This means another task for rewriting the documentation. Which makes me a bit sad.

1 comment

Tiger shipped with the heavily outdated Apache 1.3.x and PHP 4.x. While both of these versions where working and helped people to get started most of us liked working on the newer releases of that software. Besides the Apache Software Foundation has moved into security update, and critical bug fix only mode for the 1.3.x series of the web server and as we all know the PHP project as announced end of life for PHP 4. Its a good time to move on as I showed you how to do on my blog.

To my surprise however I found when plating around with my Leopard install it has as default the latest version of Apache and PHP installed per default. You still need to activate the PHP module yourself by uncommenting it in the httpd.conf configuration file which is in a new location by the way.

The new location of the configuration and the modules is in ‘/etc/apache2/’ instead of the default ‘/etc/httpd/’ you would expect. I’m sticking to the last one by the way for my installation.

The modules are installed in ‘/usr/libexec/apache2/’ and there are some remarkable modules name in there. What would you think of a module called mod_bonjour, I wonder what that one does. Another one is mod_auth_svn which would indicate a default installation and wonder me it’s installed. Mod_perl and mod_fast-cgi are there as well. I will try to mimic the availabilty of these modules in my install scripts.

PHP is another question, with php-info() you can retrieve the configure command-line, it looks like:

./configure '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--with-apxs2=/usr/sbin/apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--with-mysql-sock=/var/mysql' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql=/usr' '--with-openssl' '--with-xmlrpc' '--with-xsl=/usr' '--without-pear'

Which looks a lot what I had with some extra’s, I’m looking into which ones I will add.

2 comments

There is a small issue with installing MySQL on Leopard. The preference pane to start/stop Mysql does not work. Don’t know why but it just doesn’t. It will start manually but you need to make a slight adjustment to one file called ‘mysql.server’ in the directory ‘/usr/local/mysql/support-files/’. On line 62 change:

user=mysql

into

user=_mysql

The following has happened in Leopard. All the users that are used for running applications have a changed username. All the daemon users start with an underscore in Leopard. This means that the user ‘mysql’ which we remember in Tiger is currenty known as ‘_mysql’. You will see this user as the owner of ‘/usr/local/mysql/data’. So somehow everything gets installed with the correct user.

The error of the Preference pane has been logged as a bug on the MySQL bug site.

If anyone can explain why the usernames have changed I would like to know!

By the way the only difference in installing MySQL on Leopard is the configure statement to compile MySQL, the rest is still the same. The new ./configure statement for PowerPC and Intel based Macs is:

./configure --prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
--libexecdir=/usr/local/mysql/bin \
--libdir=/usr/local/mysql/lib \
--with-server-suffix=-standard \
--enable-thread-safe-client \
--enable-local-infile \
--enable-shared \
--with-zlib-dir=bundled \
--with-big-tables \
--with-readline \
--with-archive-storage-engine \
--with-innodb \
--without-docs \
--without-bench

As you see the CFLAGS have gone, the new XCode tools do their auto detection a lot better I guess.

5 comments

« Previous Page