Installation of 2.1 on Mac OS X 10.3.9

From WeBWorK_wiki
Jump to navigation Jump to search
This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.

Installing WeBWorK2.1 on Mac OS 10.3.9:

Apologies for the length of this - I didn't know what I was doing, and wrote this for others who know as little as I did.

Essentially I followed the procedure outlined in Webwork 2 Installation Manual, but there were a number of complications of various sorts.

Step 1: Get apache working with mod_perl.

Since this will involve compiling apache and mod_perl (and some other things) from source, you'll need development tools. I installed XCode 1.5, which is the most recent version for Panther.

This is available from Apple's website if you sign in as a developer.

Once you do this, you will have perl 5.8.1, so you can skip the steps concerned with compiling and installing your own version of perl. Check this at a terminal with

perl -v

Then I am used to using fink, so I installed fink. This can be used for various things, but I don't think you actually need fink since everything you can do with it you could do another way. But it is often easy with fink.

I did a binary install, and the packages I needed I installed with apt-get (see netpbm below).

For apache and mod_perl, I followed the detailed guidelines here: [[1]] Details of following that process follow.

Download apache and mod_perl source. I used apache_1.3.33 and mod_perl-1.29. Unpack the source someplace sensible. You do not have to follow the instructions on that page about patching apache for libapreq, but you will have to worry about libapreq in a little while (or at least I did).

Now build and install mod_perl following the instructions.

Now build and install apache following the instruction.

Now build and install libapreq according to these instructions, but see note below before making the libapreq perl modules. [[2]] I had to install Apache::Test first. I tried to do the omnibus CPAN command:

sudo perl -MCPAN -e "install Module"

where Module is the mane of the module (Apache::Test in this case). This fails because you can't "make test" as root, but you can't install unless you're root. So make and install by hand. (If you don't know how to do this, see below where I talk about more perl modules.) Then you have to make the libapreq by hand as in instruction (not with CPAN), because of the same "make test" issue.

Now, as in the instructions, edit the /usr/local/apache/conf/httpd.conf file (and not /etc/httpd/httpd.conf, which this new apache you made will not see). You'll need to edit a few other things, like the Port directive (mine was set at 8080 which is great if you have a production server on the machine you are working on, and want to test the new one without taking the production server down, but probably isn't what you ultimately want) and the UserDir which should be Sites on a Mac, not public_html. And maybe there are a couple other things like that.

Step 2: install miscellaneous stuff.

Install tth (easy once you download the source and unpack it - put the binary in /usr/local/bin).

Install netpbm (I did this with fink:

sudo apt-get install netpbm

but there are netpbm packages which you can install into /usr/local as well).

Install latex (you could do this via fink, people who know more than I do about this say that Gerben Wierda's TeX package is better, installed with his i-Installer. If you did it with fink, you'd do

sudo apt-get install tetex).

This should give you pdflatex (check with the command "which pdflatex"), and should give you dvipng. The machine I was working on had an installation of Gerben Wierda's TeX package, but no dvipng, so I installed a newer version of Wierda's TeX package, and then I had dvipng too.

Step 3: Installing the necessary perl modules.

The list of necessary perl modules is on the installation tWiki at the top of this document.

This command tells you if the module is already installed (though you won't do any harm trying to install an already installed module):

perl -MApache::Request -e 'print "installed!\n"'

This command installs a module via cpan, all at a go (downloads source, configures, make, test, install). It is very convenient when it works. cpan requires some initial setup though:

sudo perl -MCPAN -e "install Data::UUID"

Sometimes you need to install by hand. This can happen for at least two reasons - you need to pass arguments to ./configure, or the 'make test' has to be run as non-root.

The standard sequence of commands to compile perl modules by hand is to change directory into the source directory, then:


perl Makefile.PL
make
make test
sudo make install

If cpan has downloaded source but failed to install, the source will be still sitting around in .cpan/build under your home directory. But it will be owned by root (because it was unpacked under sudo) so you'll need to change ownership so that your makes (etc.) can change stuff in that directory.

So, going through the modules:

Apache::Request  already present
Data::UUID       installed with cpan
DateTime         (installed Module::Build first.  Still didn't work.  
                  Went to install by hand.  Noted DateTime::TimeZone missing.
                  Installed this with cpan!  Then DateTime by hand)
Date::Format     installed with cpan
Date::Parse      already present
GD                   see below

GD was more complicated to install because one needs a recent version of libgd, which I didn't have. See David Cervone's contribution on this thread: [[3]]

It took me several tries to get things right. I think the biggest problem is that I'd installed early libgd stuff with fink. Eventually I got it to compile when I removed the libgd stuff I'd added with fink.

In the meantime I'd taken the following steps:

  • removed (with fink) the libpng3 stuff.

I probably shouldn't have done this, but it made some error messages go away to be replaced by others.

  • edited source by hand so that some header files in /sw/include were included correctly.

I don't know why this was necessary since I'd passed the CPPFLAGS=-I/sw/include in the ./configure step.

It is possible that neither of these steps would have been required if I hadn't installed earily libgd stuff with fink.

Anyway, at this point I could build libgd.

And then I could build the perl modules GD.

Mail::Sender      installed with cpan
SOAP::Lite        (installed MIME::Parser with cpan.  Then SOAP::Lite 
               	installed)
Time::HiRes       installed with cpan
XML::Parser       by hand - couldn't find expat.  Used from /sw/.  
                  (I had used fink to install expat at some point).
XML::Parser::EasyTree  installed with cpan
XML::Writer            installed with cpan
DBI                    already there.
DBD::mysql             compiles, but needs mysql to test (and install).

Step 4: Install MySQL.

Download for Mac OS a package from MySQL. I got version 4.1.13.

I needed to change ownership on /usr/local/mysql/data to owner mysql.

sudo chown -R mysql /usr/local/mysql/data 

mysqld starts with

cd /usr/local/mysql; sudo bin/safe_mysqld

shuts down with

sudo /usr/local/bin/mysqladmin shutdown

OK, now (with mysqld running) can finally compile and install DBD::mysql.

Step 5: Install webwork proper.

Well, this part is just as in the instructions. I downloaded pg-2.1.3 and webwork-2.1.3, and followed the instruction.

I've done some very small scale testing, but have never used webwork before, and this system isn't being used for a course. I haven't run across any problems, but I don't know that there aren't any.

-- Main.HalSadofsky - 13 Sep 2005