NicToolServer Installation
I just picked up a 14" iBook so I have a "clean" Panther install to install NicTool on. This is good, as it means that I'll document the entire process. This wouldn't work so well on my dual G5 or Powerbook because I have them all hacked up (custom perl, Apache 2, MySQL, etc, etc).
1. Install Developer Tools
It's hard for me to imagine, but installing Developer Tools isn't the very first thing some folks do when they get their new Mac. For the purposes of installing NicTool, it's required. Open Applications -> Installers -> Xcode Tools -> Developer.mpkg"
TIP: If you choose a custom install and uncheck the documentation, you can save yourself 900MB of disk space. That documentation is wonderful if you're a developer, useless otherwise. If in doubt, you're not a developer.
2. Enable mod_perl
MacOS X has Apache pre-installed. Thankfully, Apple has pre-compiled and installed nearly (if not) all the Apache modules. We have merely to comment out the ones we want enabled. Edit the file "/etc/httpd/httpd.conf", find the two mod_perl lines (LoadModule perl_module.. & AddModule mod_perl) and remove the # characters that are commenting them out. I do this via Terminal, and the command:
vi /etc/httpd/httpd.confIf you're not comfortable with Terminal, I'd suggest using BBEdit for this task.
3. Install dependencies
Expat: http://sourceforge.net/projects/expat/
Download the expat sources, expand them, and install with "./configure; make; sudo make install"
MySQL: http://dev.mysql.com/downloads/mysql/4.0.html
Download the installer, and follow the instructions to install MySQL. If you intend to run NicTool on MySQL locally (ie, upon the computer on which you are now install NicTool), then also install the MySQLStartupItem. Else, do not.
Perl modules: NicTool requires a few perl modules to be installed. Using CPAN is the easiest way to install them so I shall present that method. There are other ways. If you haven't used CPAN prior to this, you'll get a prompt when you first run it. Simply hit enter until you get to the "select mirrors" part. Then choose some mirrors that are geographically near you.
sudo perl -MCPAN -e shell install URI install LWP install XML::Parser install RPC::XML install MIME::Parser install SOAP::Lite install DBI install DBD::mysql install Apache::DBIYou may have problems getting DBD::mysql to install. If so, read this Mac OS X hints article to see how to resolve the problem.
4. Download the sources: NicTool
5. Expand the sources:
tar -xzf NicTool-X.XX.tar.gz
4. Install the perl modules:
cd NicToolServer-X.XX
perl Makefile.PL
make install clean
cd ../NicToolClient-X.XX
perl Makefile.PL
make install clean
5. Move the sources to their long term resting place:
cd ..
sudo mkdir -p /usr/local/www sudo mv NicToolServer-X.XX /usr/local/www/NicToolServer
sudo mv NicToolClient-X.XX /usr/local/www/NicToolClient
6. Configure Apache
If you run NicToolClient on a seperate server, then you'll want your vhost to listen on an external IP address instead. These are additions to make to your httpd.conf file:
PerlTaintCheck Off Listen 8010 PerlRequire /usr/local/www/NicToolServer/nictoolserver.conf PerlRequire /usr/local/www/NicToolClient/lib/nictoolclient.conf <VirtualHost 127.0.0.1:8010> KeepAlive Off <Location /> SetHandler perl-script PerlHandler NicToolServer </Location> <Location /soap> SetHandler perl-script PerlHandler Apache::SOAP PerlSetVar dispatch_to "/usr/local/www/NicToolServer, NicToolServer::SOAP" </Location> </VirtualHost> <VirtualHost> ServerName localhost Alias /images/ "/usr/local/www/NicToolClient/htdocs/images" DocumentRoot /usr/local/www/NicToolClient/htdocs <Files"*.cgi"> SetHandler perl-script PerlHandler ModPerl::Registry Options +ExecCGI </Files> </VirtualHost>
7. Create MySQL database and permissions.
cd /usr/local/www/NicToolServer/sql
PATH=/usr/local/mysql/bin:$PATH
perl create_tables.pl
8. Configure nictoolserver.conf
vi /usr/local/www/NicToolServer/nictoolserver.conf
9. Restart Apache
10. Test Installation
cd /usr/local/www/NicToolServer
perl Makefile.PL
make test