Installing Perl and Moveable Type in MacOS X “Panther

The Following instructions will help you to install mod_perl and Moveable Type on your MacOS X Panther (10.3.x) system. This will not work for previous versions of MacOS X.

Requirements:

These instructions are based on the excellent packages provide by Aaron Fabi and Server Logistics. You should download and install the packages for:

  1. Complete Apache (10.3)
  2. Complete PHP4
  3. Complete MySQL

Once you have those packages installed and running you only need mod_perl and Moveable Type itself to get the Moveable Type blogging software to work on your system.


Instructions:

Installing mod_perl

  1. Download and uncompress current mod_perl 2.0 release from perl.apache.org. Save it to your desktop and uncompress the file.
  2. Inside the new “mod_perl-2.0….” folder, open the ‘INSTALL’ document (Just drag it to TextEdit, Taco, or TextWrangler in the Dock). This will give you the same basic instructions you’ll find here and might explain some other things as well.
  3. Open the Terminal application in /Applications/Utilities. Navigate to the new mod_perl directory with the following commands:

    • cd Desktop
    • cd mod_perl-2.0.*
  4. Now you’re in the right place. Run the following command to prepare mod_perl to be installed. This command tells mod_perl where your Apache lives. This is important because you have installed the Server Logistics Apache distribution and need to make sure mod_perl uses that one, and not the one supplied by Apple.:
    • perl Makefile.PL MP_APXS=/Local/Apache2/bin/apxs
    • If it complains about a previous install of mod_perl, type “y” to agree to use the new install instead.
  5. Once mod_perl has been configured it needs to be “built” and tested on your computer before you install it. Do this by simply typing this command (the && means to do two commands, one after the other!). This could take a long time.

    • make && make test
  6. Finally, if no big errors pop up, you can install the software. Type this final command in Terminal.
  7. NOTE: After installing mod_perl, the “Stop” and “Graceful” buttons in the Apache 2 System Preference Panel might not work. If this is the case, you simply have to restart Apache from the Terminal instead. You can do so by typing the following:

    • /Library/Apache2/bin/apachectl graceful
    • or

    • /Library/Apache2/bin/apachectl start

Testing Apache and mod_perl

We need to test your new mod_perl enabled Apache Webserver. We can do that with the familiar < ?php phpinfo()?> command.

Simply Go to your htdocs folder in /Library/Apache2/ (Tip: create an alias for it on your Desktop!). Create a new file called “index.php” and inside type this single line and save it in htdocs:

  • < ?php phpinfo()?>

in your Browser go to:

http://localhost/index.php

You should see a whole bunch of information about PHP. Find the “Apache Environment” Section and in the “Server_Software” variable you should see something like this:

  • Apache/2.0.52 (Unix) DAV/2 PHP/4.3.9 mod_perl/1.999.21 Perl/v5.8.1

If you don’t see the “mod_perl” part, then the install has failed somewhere along the way! 🙁

If you do, then you’re ready for Moveable Type! 😀

Installing Moveable Type

These instructions follow the instructions in the MT documentation very closely. You may want to consult them as well.

  1. Prepare the Database. You need to create a new database for moveable type (called mt) to use. You also need to create a user (username: mt , password: mt) for MoveableType. You can do this using the Terminal.

    Type the following commands:

    • mysql -u root -p
    • CREATE DATABASE mt;
    • use mysql;
    • GRANT ALL ON mt.* TO mt@localhost IDENTIFIED BY “mt”;
    • FLUSH PRIVILEGES;
    • exit;
  2. Next you need to make sure Perl can talk to your new Database. We do this by installing a Perl “Module”. The folks at Perl have made a nice utility called “CPAN” that allows us to install modules quickly and easily. The first time you run it, though, it will ask you a bunch of questions to get things setup. Just accept the default answers, and when it asks for the URLs you’d like to use, pick 3 or 4 that are closest to you.

    In Terminal, here are the commands to get us started in Perl and CPAN:

    • sudo perl -MCPAN -eshell

    Once you’ve finished the initial setup you’ll need to actually install the packages that you need for PERL and MoveableType and your Database.

    Type the following commands… each one could take quite awhile to install. Just be patient and it will eventually finish. Be sure that you install all the dependencies that it asks for as well. The last package, DBD::mysql might fail. Don’t Worry! We’ll fix that in the next step.

    • install DBI
    • install Bundle::DBI
    • install Test::Simple
    • make DBD::mysql
  3. If the last command “make DBD::mysql” is successful, ignore this step. Otherwise, you need to fix a file in MacOS X to make Perl happy. This is a bug in MacOS X. Hopefully a future update of MacOS X will fix this thing for us.
    • Go to this folder: /System/Library/Perl/5.8.1/darwin-thread-multi-2level
    • Select “Get Info” on this file: Config.pm and change the Ownership to your username.
    • Open Config.pm and change the line (it’s around Line #822):
    • ld=’MACOSX_DEPLOYMENT_TARGET=10.3 cc’
    • to
    • ld=’env MACOSX_DEPLOYMENT_TARGET=10.3 cc’
  4. Save the File and Change the Ownership back to “system”
  5. MacOS X Server 10.3.x users!:
    If you are using the builtin mySQL provided with MacOS X Server you need to do one more step before perl will “make” DBD::mysql.

  1. Find your “mysql_config” file. It should be in /usr/bin
  2. Find the first “ldflags” and “cflags” declarations and remove “-arch i386” from the string.
  3. Save mysql_config and then continue.
  • Now you can go back to your previous Terminal window (or type sudo perl -MCPAN -eshell) and install DBD::mysql by typing:
    • force install DBD::mysql
  • Download and uncompress Moveable Type. Keep the folder on your desktop for now.
  • You need to create 3 folders for moveable type. One contains the CGI scripts that actually run Moveable Type, one contains the “static” html and images for moveable type, and one contains your actual blog.

    First modify the permissions for the cgi-bin directory.

    • Click on the “cgi-bin” folder in the /Library/Apache2 folder and select Get Info from the File menu.
    • Reveal the “Ownership & Permission” and click the lock… this will allow you to modify the permissions. You want to give the “admin” group “Read and Write” access. Do this by first changing the “Owner” to your username. Then change the “Group” access to “Read and Write”. Then change the Owner back to “System” and click the lock to finish.

    Now you’re ready to create the folders you need:

    • Create a folder called “mt” in cgi-bin
    • Create a folder called “mt” in htdocs
    • Create a folder called “mt-static” in the new mt folder in htdocs
  • Now you need make a few modifications to Moveable Types files in the MT-3.1.* folder on your desktop. You need to modify “mt.cfg” and “mt-db-pass.cgi”

    In mt.cfg local for the following commands and make the appropriate changes (remove any dollar signs for these commands they act as “comments” like /* in HTML):

    • CGIPath http://your.ip.address.here/cgi-bin/mt/
    • ObjectDriver DBI::mysql
    • Database mt
    • DBUser mt
    • DBHost localhost
    • EmailAddressMain chrisale@mac.com
    • StaticWebPath /mt/mt-static/
  • In mt-db-pass.cgi delete what’s inside and replace it with the password you used for the mt user for your database

    • eg: mt
  • One file “mt-load.cgi” needs to be changed so that it is “executable”. We do that in the Terminal.

    Open a Terminal Window and Type:

    • cd Desktop/MT-3.14-full-en_us
    • sudo chmod 775 mt-load.cgi
    • sudo chmod 777 /Library/Apache2/htdocs/mt
  • OK, you’re Almost There! We just need to move the files into the right places.
    • Into “mt-static” put the “images”, “docs”, “styles.css” and “mt.js” files and folders.
    • Into “mt” in the CGI-BIN directory put everything else.
  • Open your browser and type: http://localhost/cgi-bin/mt/mt-check.cgi

    It should report that you have everything you need to initialize and configure Moveable Type.

    Now go to: http://localhost/cgi-bin/mt/mt-load.cgi

    It should build the database and report that you have a working install of Moveable Type!

  • Before you login and start using Moveable Type you need to Delete or Rename mt-load.cgi. Do that now, it will keep your moveable type installation secure from bad people.
  • Now Login to Moveable Type: http://localhost/cgi-bin/mt/mt.cgi
    • Username: Meloday
    • Password: Nelson
  • In “First WebLog” go to “WebLog Config”
  • Make the following changes:

    Local Site Path: /Library/Apache2/cgi-bin/mt

    Site Url: http://your.ip.address.here/mt/

    Local Archive Path: /Library/Apache2/htdocs/mt/archives

    Archive URL: http://your.ip.address.xxx/mt/archives/

  • Click Save… then Rebuild the site.
  • You’re DONE! You can now find your blog at http://your.ip.address.here/mt/ Make sure you change that default username and password to something more “personalized!:D

    Discover more from Murkyview

    Subscribe now to keep reading and get access to the full archive.

    Continue reading