November 05, 2003

Installing Movable Type To Personal Space at UNC

1. These directions are meant to be used in conjunction with the Movable Type Installation Instructions, and are laid out in a fashion similar to those instructions. Always Read the Fine Manual.

2. Capitalization makes a difference. The systems running Movable Type are not Windows machines. Differences in lowercase and uppercase usage will affect them.

3. Before you download and install Movable Type you will need to subscribe to the personal cgi service at Onyen.unc.edu

Usage

In the directions below, replace all instances of &lt onyen &gt with your personal onyen.

Prior to Download

Create a directory named "mt-static" in your public_html directory. Once that is done you'll need to add an entry to the AFS access control list for the new directory. This is the entry you will need:

&lt onyen &gt.cgi rldiw

A tutorial on AFS permissions and how to change them is available here.

Once you have added the correct entry to the mt-static directory, create an "archives" folder within it. It will inherit the changed permissions on the mt-static folder, so you will not have to change the AFC access permissions on it.

Downloading

Download the files needed from Movable Type's download page. You do not need to download the "Full Version with Libraries," as the Full Version is sufficient, and takes up less space. However, if you wish to use the PostgreSQL database backend, the SQLite database, or the Image::Magick perl module, which is needed if you would like to be able to create thumbnails of uploaded images, then you will need to download the "Full Version with Libraries."

Save the .zip or .gz file you've chosen to your public_cgi directory.

Finding Perl on your Server

Once your blog is up and running, the main UNC web servers will be serving your content to the world, and perl does not reside at /usr/bin/perl on those machines. They instead use the perl binary residing in this location:

/afs/isis/pkg/isis/bin/perl

You will have to change the path to perl on the following scripts: mt-add-notify.cgi, mt-check.cgi, mt-comments.cgi, mt-load.cgi, mt-send-entry.cgi, mt-tb.cgi, mt-search.cgi, mt.cgi, mt-xmlrpc.cgi, and mt-view.cgi scripts. Don't worry about doing this yet.

Installation Directories

Both examples below will install Movable Type into your personal cgi-bin (the public_cgi folder in your home directory), and use the default Berkeley DB as its database. UNC uses a customized cgi protection script known as "k-wrap" that is the equivalent of the cgiwrap and suexec applications mentioned by the Movable Type directions

Double-click on the MT-2.64.zip file in your public_cgi folder. If nothing happens, download and install winzip, then try again.

Once winzip opens, extract all the files to your public_cgi folder. Once you close Winzip, a MT-2.64 folder will be present in that folder. Open it. Move the "docs" folder, the "images" folder, the "styles.css" file and the "index.html" file to the "mt-static" folder you created earlier in your public_html directory.

Once all that is done, create a new folder inside the MT-2.64 directory. Name it "db".

Note to both Command Line and Windows users. At this point the AFS permissions for the folders you just moved and the one you just created need to be changed, much as they were for the "mt-static" folder above.

Add "atn:webhosts rl" to the access control list on "images" and "docs."

Also add "atn:webhosts rl" to the access control list on the "lang-en-us" folder that is inside the "images" directory.

Change this entry on the "db" folder
&lt onyen &gt.cgi rl

to this
&lt onyen &gt.cgi rlidwk

Once again, a tutorial on afs permissions and how to change them is available here.

Configuration

1. Open mt.cfg
So far, so good. The situation now becomes slightly more complicated, however.

If you use Microsoft Word or Wordpad to open mt.cfg, the program will add a "^M" to the end of each line when you save it, and MT will choke on it later. See this document for more details. Basically, you will have to run the program the help document above mentions against every file that you alter using Microsoft Word or Wordpad before Movable Type will function, and that program runs from the command line.

As far as I'm concerned, it's easier just to learn vi and alter the files that way. Note that you can use Notepad without gumming up the files, but the layout of the file in Notepad is confusing.

2. Configure Movable Type URL

The line should look similar to this:
CGIPath http://www.unc.edu/usr-bin/&lt onyen &gt/MT-2.64

3. Configure Database options

Skip.

4. Configure path to Database directory (for Berkeley DB).

Skip.

5. Configure path to Static files

Change this line
# StaticWebPath /path/to/static-files/

to this line
StaticWebPath http://www.unc.edu/~&lt onyen &gt/mt-static/

7. Save and exit mt.cfg.
Remember to run the win2unix program if you used Word or Wordpad to make the changes.

8. Set your SQL database password
Skip

Uploading Files
Skip

Checking for Perl Modules
The following perl Modules are NOT installed as of 11/04/2003. Note than none of them are necessary for the setup described above.

DBD::Pg...
DBD::SQLite...
Image::Magick

Now, update the path to perl on the mt-add-notify.cgi, mt-check.cgi, mt-comments.cgi, mt-load.cgi, mt-send-entry.cgi, mt-tb.cgi, mt-search.cgi, mt.cgi, mt-xmlrpc.cgi, and mt-view.cgi scripts. Remember to run the win2unix program against each file if you used Word or Wordpad to make the changes.

Initializing the System

There are two ways to initialize the Movable Type system, either by using the browser to load http://www.unc.edu/usr-bin/&lt onyen &gt/MT-2.64/mt-load.cgi or by running it from the command line.

$./mt-load.cgi

However, in order for the script to run correctly, and for Movable type function correctly afterwards, the AFS permissions must be correct on the "db" folder.

If the permissions are incorrect on that folder, any attempt to run the mt-load.cgi from the browser will result in the following message:

Loading initial data into system...
Loading weblog...

An error occurred while loading data:

Tie 'db/blog.db' failed: Permission denied

This error will not occur if the script is called from the command line, but all attempts to login to Movable Type afterwards will fail with the words "Invalid Login."

If either of these errors occurs, re-read the "Installation Directories" section on the correct AFS permissions for the "db" folder.

Once the mt-load.cgi script has run successfully, you should be able to sign in to Movable Type using the Melody/Nelson account/password at this url:

http://www.unc.edu/usr-bin/&lt onyen &gt/MT-2.64/mt.cgi

However, further configuration is need before you will be able to post messages.

Running Movable Type

Once you have added yourself as an author and removed the Melody Nelson account (make sure you assign all available permissions to yourself first!), click on "Manage Weblog", then on "Weblog Config." You will see 6 text boxes.

The first text box allows you to change the name of your weblog.

The second text box is the path to your main index file. Replace "public_cgi/MT-2.64" with "public_html/mt-static".

The third text box is the URL of your public website. Change "http://www.unc.edu/" to "http://www.unc.edu/~&lt onyen &gt/mt-static".

The fourth text box is the path to your archive files. Replace "public_cgi/MT-2.64" with "public_html/mt-static". Be sure not to delete the word "archives" at the end of the path.

The fifth text box is the url of your archives. Change "http://www.unc.edu/archives" to "http://www.unc.edu/~&lt onyen &gt/mt-static/archives".

The sixth text box is for your local time. Set it to whatever you like.

Save the changes and rebuild when the application prompts you to. As none of the other configurations are critical to site functionality, this document will not address them.

First time visitor to House Hraka? Wondering if everything we produce could possibly be as brilliant/stupid/evil/pedantic/insipid/inspired as the post you just read? Check out the Hraka Essentials, the (mostly) reader-selected guide to Hraka's best posts, and decide for yourself.

Comments

Hopefully someone will see this.

I'm trying out your directions on installing moveable type to my UNC onyen account. I'm stuck on editing the different files (mt.cfg and the cgi-scripts). The link on how to run VI editors seems to asume UNIX access and knowledge. Is there a non-unix way to edit the files? I've looked at the win2unix help file but to my unelucidated mind it looks like more UNIX action to me.

I just wanted to say thank you for writing all this. I'm working on setting up a blog at Iowa State that also uses AFS, and I don't know whether I would have been successful without your help. It'll probably be a bit yet before it goes up, but I'm well on my way.