Rebuilding djwudi.com

This entry was published at least two years ago (originally posted on October 15, 2003). Since that time the information may have become outdated or my beliefs may have changed (in general, assume a more open and liberal current viewpoint). A fuller disclaimer is available.

This is going to be my repository for keeping track of what I do to install and configure the djwudi.com server. As such, it’s likely to be filled with all sorts of geeky bits of no interest to anyone except me. Feel free to ignore it. :)

20031015 2315: Install OS X 10.2

The first bit is fairly obvious.

Installation options: all localization options, extra applications, etc. are off. I’m installing merely the core OS and the BSD subsystem. As this is now going to be a dedicated server, rather than a combination server and workstation, I don’t need the extra goodies such as iTunes, iPhoto, yadda yadda yadda.

20031015 2352: Reconfigure home network

Apartment Network

Something’s going goofy here. The G5 sees the ‘net fine, the G3 suddenly isn’t. Odd — it did last night after a fresh system install with the same settings. Going to have to track that down soon — hopefully it’ll cure itself after a reboot, as I’ve got some more installations to go. In the meantime, my current network setup is shown in the graphic.

[Update:]{.underline}

Figured out the ‘goofyness’. When entering the DNS servers, make sure you get all the numbers entered correctly. It helps.

20031016 0019: Install developer tools

All options (including the BSD SDK, which is off by default) are on.

20031016 0054: Install all necessary software updates from Apple

Installing: IE 5.2.2 Security Update, Mac OS X Update Combined 10.2.8, QuickTime 6.3, Safari 1.0, StuffIt Expander Security Update 7.0, and Java 1.4.1.

Not installing: iMovie 3.0.3, iPhoto 2.0, iPod Software 1.3, iPod Software 2.0.1, iTunes 4.0.1, or iCal 1.5.1.

20031016 0202: Fine-tune initial setup

Adjust all system prefs to taste (Energy Saver needs to be set to never go to sleep), enable file sharing, web sharing (Apache), SSH access, and FTP access, verify that the webserver is responding (it is, though nothing’s there yet), nod in satisfaction, yawn, and go to bed.

20031016 2319: Set up and configure sendmail

Most if not all of the following commands need to be executed as root. All usernames, domain names, and variables listed below as are I set them for my server. If anyone else is going through this page as a reference, your variables will need to be adjusted for your system.

  1. Start sendmail automatically at system boot^1^.
    • Edit /etc/hostconfig: change MAILSERVER=-NO- to MAILSERVER=-YES- and set HOSTNAME=-AUTOMATIC- to HOSTNAME=djwudi.com
  2. Make sendmail play nice with Mac OS X’s permissions^2^.
    • cp /usr/share/sendmail/conf/cf/generic-darwin.mc /etc/mail/config.mc

    • Create the following script, save as /etc/mail/update, and make it executable (chmod g+x /etc/mail/update or chmod 654 /etc/mail/update):

      #! /bin/sh
      
      if [ /etc/mail/config.mc -nt /etc/mail/sendmail.cf ]
      then
          echo Regenerating sendmail.cf
          m4 /usr/share/sendmail/conf/m4/cf.m4 /etc/mail/config.mc > /tmp/sendmail.cf
          mv /etc/mail/sendmail.cf /etc/mail/sendmail.cf.old
          mv /tmp/sendmail.cf /etc/mail/sendmail.cf
          /System/Library/StartupItems/Sendmail/Sendmail restart
      fi
      
    • Edit /etc/mail/config.mc and add the following line just after define(PROCMAIL</code>&hellip;: <ul> <li><code>define(confDONT_BLAME_SENDMAIL’, `GroupWritableDirPathSafe’)

    {=html}
    <!-- -->

  3. Run the update script:
    • ./update
  4. Tweak netinfo per Apple’s suggestions^2^.

    • niutil -create . /locations/sendmail
    • niutil -createprop . /locations/sendmail sendmail.cf /etc/mail/sendmail.cf
  5. Define hostnames to accept incoming e-mail for^1^:

  6. Edit /etc/mail/local-host-names and add:

    djwudi.comgeekmuffin.comhanscomfamily.com

      </li>
      <li>Restart sendmail:
        <ul>
          <li><code>ps -ax | grep sendmail</code></li>
          <li><code>kill -HUP xxx</code> (where <em>xxx</em> is the process ID of whichever sendmail process ends with <code>-q1h</code>)</li>
        </ul>
      </li>
    </ul>
    
  7. Set e-mail aliases^1^.

  8. Start NetInfo Manager.

  9. Unlock it.

  10. Click on / > Aliases.

  11. Create a new folder (leftmost button or, in the menus, Directory > New Subdirectory).

  12. Rename the new directory webmaster.

  13. Insert a new property (in the menus, Directory > New Property).

  14. Download and build the IMAP server^1^.

    • curl ftp://ftp.cac.washington.edu/imap/imap.tar.Z > imap.tar.Z
    • uncompress imap.tar.Z
    • tar xf imap.tar
    • cd imap-2002e/
    • make osx SSLTYPE=nopwd SSLDIR=/usr SSLCERTS=/etc/sslcerts
    • mkdir -p /usr/local/bin
    • cp imapd/imapd /usr/local/bin/imapd
  15. Configure the IMAP server^1^.
    • Set up the security certificate:
      • mkdir -p /etc/sslcerts
      • openssl req -new -x509 -nodes -out /etc/sslcerts/imapd.pem -keyout /etc/sslcerts/imapd.pem -days 3650
      • Follow the prompts and insert the correct information when required.
    • Set OS X to answer to IMAP requests over SSL port 993.
      • Edit the /etc/inetd.conf file and add the following line at the end of the file:
      • imaps stream tcp nowait root /usr/libexec/tcpd /usr/local/bin/imapd
      • Restart the inetd daemon:
        • ps -ax | grep inetd
        • kill -HUP xxx (where xxx is the process id of inetd)

At this point, sendmail works for sending messages from the server, and I can log into the IMAP server and check my messages using Mail.app on my G5. Unfortunately, I can’t figure out how to send mail from a machine other than the server — any settings I use result in errors of one sort or another. For now, I’m going to stick with what I have, and come back to tackling IMAP at another day.

20031017 1039: Continue to configure mail services

  1. Allow djwudi.com to catch mis-addressed email^2^.
    • Edit /etc/mail/config.mc and add the following line just after where we added ‘DONT_BLAME_SENDMAIL’ earlier:
    • define(LUSER_RELAY',local:djwudi’)
    • Rebuild and restart using the update script (./update)
  2. Allow relaying from trusted hosts^2^.
    • Edit /etc/mail/access to include my G5 by adding the following lines:
      • 216.231.44.207 RELAY
      • dsl231-041-022.sea1.dsl.speakeasy.net RELAY
    • Compile for use with sendmail:
      • makemap hash /etc/mail/access < /etc/mail/access

And that solved my problem from last night where I couldn’t send mail from my G5. Rock on — I’m learning things bit by bit. Fun!

20031017 2137: Finalize tweaking sendmail (for the moment)

  1. Tweak the sendmail update script to ease work down the road^2^.

  2. Add the following two ‘if/fi’ commands to the script shown above (20031016 2319 item 2). Running the final script will then check to see if the sendmail.cf, aliases, or access files have been updated since it was last run, and if they have, it will rebuild and restart sendmail.

    if [ /etc/mail/aliases -nt /etc/mail/aliases.db ]
    then
        echo Updating aliases
        newaliases
    fi
    
    if [ /etc/mail/access -nt /etc/mail/access.db ]
    then
        echo Updating access
        makemap hash /etc/mail/access < /etc/mail/access
    fi
    
      </li>
    </ul>
    

20031017 2206: Set up user accounts.

If you don’t know how to do that without bulleted and numbered steps, you probably shouldn’t be reading the rest of this webpage. ;) In any case, there are now user accounts for myself, dad, and Kirsten on the server.

20031017 2235: Start tweaking the webserver.

  1. Enable SSI^3^.
    • Remove the # characters (uncomment) the following two lines in the /etc/httpd/httpd.conf file:
      • # AddType text/html .shtml
      • # AddHandler server-parshed .shtml
    • Find the Directory directive for /Library/Webserver/Documents and add Includes to the end of the Options line.
    • Save httpd.conf and restart Apache.
  2. Enable PHP^4^.
    • Edit the /etc/httpd/httpd.conf file and uncomment the LoadModule and AddModule lines that handle PHP.
    • Add the following two lines (I added them just underneath where we uncommented the SSI AddType lines):
      • AddType application/x-httpd-php .php
      • AddType application/x-httpd-php-source .phps
    • Save httpd.conf and restart Apache.
  3. Allow serving SSI and PHP files by default along with HTML^5^.
    • Edit /etc/httpd/httpd.conf, find the DirectoryIndex line, and add index.php and index.shtml to the end of the line. Now, when no filename is specified, Apache will default to each choice in order — first looking for index.html, then index.php, then index.shtml.
  4. Things that I’m not going to play with yet, but will come in handy later: Custom Error Pages, .htaccess information, and password protecting directories are all covered in the document referenced at footnote 5.

20031018 0013: Back up a bit and go for better upgrades!

Well, here’s a nice find. I was poking around for other good Mac OS X apache/perl/php/sql etc. resources on the ‘net, and happened across Server Logistics, who offer pre-compiled OS X .pkg installers for Apache 2 (rather than 1.3.27), PHP4 with more added extentions, Perl 5.8.0 (rather than 5.6.0), [mod_perl 1.99_07], MySQL 4.0.15, and a few other packages that I probably don’t have a need for.

So, it looks like my next step is upgrading all of those packages. At least I discovered this while I was still fairly early on in the installation and configuration process!

[Update:]{.underline}

Okay — all of the above listed software packages have been installed on the server.

20031018 0211: Install MovableType

  1. Download MovableType^6^.
  2. Install MovableType following the provided instructions^7^.

20031018 1432: Whoops

Well, during the MovableType install process, I realized that I needed the DBD::mysql perl module installed to allow MovableType to talk to the MySQL database. A few hours of playing then convinced me that the one downside to the Server Logistics MySQL package was that it used non-standard installation locations, which caused issues with getting DBD::mysql installed. I fought with it for a while, until I got to the point where it was easier to just give up.

My next approach was to remove the Server Logistics MySQL package, and replace it with another one that I’ve used in the past^8^. However, that installation apparently didn’t like some of what was left over after removing the prior installation, and it told me to kiss off. Not in so many words, of course, but that was the result.

So, just to be on the safe side, I’m starting over. OS X is re-installing (again) now, and I’ll go through everything I’ve detailed above (again). At least this time it’ll be easier, as I won’t have to muddle my way through figuring it all out again. I’ll set everything up the same way I had been, only using the MySQL package I’m more familiar with instead of the new one that caused me issues.

Ah, the joys of geekdom…

20031019 1258: Starting over again

So, I started over. Yesterday got OS X installed and updated. Today so far, I’ve installed the OS X developer tools, and set up and configured both sendmail and imapd. This all goes much faster since I thought to write it all down the first time!

Now I’m at the point where, the first time through, I started tweaking the webserver setup, only to get distracted partway through by finding the Server Logistics packages. This time, I’m going to start by installing their packages (except for the MySQL package), then install MySQL from the package I’m more familiar with, then continue on and see where things go from there.

20031019 1451: Last few installs before MovableType (I hope)

  1. Install lynx^9^.
    • The downloadable installer puts lynx in /usr/local/bin/ rather than /usr/bin/, and isn’t seen by the default shell after an installation. I solved this by creating a symbolic link to lynx (ln -s /usr/local/bin/lynx /usr/bin/lynx).
  2. Install wget^11^.
    • Same caveats as with lynx.
  3. Install ncftpget^12^.
  4. Update CPAN^10^.
    • perl -MCPAN -e shell
    • Follow the questions at the prompts. All defaults should be acceptable.
    • Once setup is done, at the CPAN prompt, type install Bundle::CPAN
    • After CPAN updates, type reload cpan
    • (Optional: at the CPAN prompt, type r to get a list of installed modules that have been updated. For any modules that you want to update, just type install [module name] to update them to the most recent versions.)
    • At the CPAN prompt, type install Bundle::DBI
    • At the CPAN prompt, type install Bundle::DBD::mysql
  5. Install Image::Magick^13^.
    • Well, that doesn’t seem to work (at least according to mt-check.cgi). Moving on…
  6. Install Fink^15^.
  7. Install NetPBM^14^.
    • Well, this is nice. The OS X binary package for Fink now comes with a GUI application for managing Fink packages called ‘Fink Commander’. Using that, installing NetPBM was a single-click operation, and I’m now installing the Fink package for Image::Magick also, to see if that works any better than my first attempt did. One way or another, I’ll have image manipulation available for MovableType!
    • Image::Magick threw a fit because I don’t have an X11 window manager installed. No biggie, I’ll just go with NetPBM.

20031019 1636: Install MovableType

  1. Download MovableType^6^.
  2. Install MovableType following the provided instructions^7^.

Footnotes/References

  1. O’Reilly Network: Setting up a Site Server with Jaguar
  2. O’Reilly Network: Configuring sendmail on Jaguar
  3. O’Reilly Network: Apache Web Serving with Jaguar, Part 2
  4. O’Reilly Network: Apache Web Serving with Jaguar, Part 3
  5. O’Reilly Network: Apache Web Serving with Jaguar, Part 4
  6. MovableType.org: Download
  7. mtinstall – Installing MovableType
  8. Marc Liyanage – Software – Mac OS X Packages – MySQL
  9. Lynx text based web browser
  10. Installing Perl 5.8 on Jaguar (scroll down to ‘Testing Your Installation with CPAN’)
  11. Apple – Downloads – Unix & Open Source – wget 1.8.1
  12. NcFTP Software: Download
  13. Marc Liyanage – Software – Mac OS X Packages
  14. Fink – Package Database – Package netpbm
  15. Fink – User’s Guide – Install

5 thoughts on “Rebuilding djwudi.com”

  1. One thing I will note: I think you actually need to have ImageMagick (the app collection and libraries) installed before Image::Magick will work. Not entirely sure, just sayin’.

  2. Well, I installed Apple’s X11 package, then went to fink to try to install ImageMagick, and it told me that it needs X11 installed. Great.

    Now, I’ve got the PHP photo album software Gallery running, and it’s accessing ImageMagick just fine, resizing photos without a problem. So obviously, ImageMagic is installed, just MT isn’t seeing it.

    I’ve also got NetPBM installed. MT won’t recognize it, either.

    I’m frustrated.

  3. I just tried a few more things with NetPBM — double-checking permissions, symlinking all the netpbm binaries into the /usr/bin directory — still no go. Dammit, I had it working before all of this…

Comments are closed.