How to Install Movable Type

This article was originally posted in a MovableType 2.661 blog – now imported into WordPress, which is much easier to use.

The Web Log you are now reading was created with a server-based publishing system called Movable Type. Installing server-based software isn’t difficult, but it requires many more manual steps than installing a program on your local computer. Before you can run an installation script, you must first put the files in the correct places on the server, set the correct permissions, manually create any necessary databases, and correctly specify configuration parameters.

This is not hard to do if the software comes with precise, complete, and clearly written instructions. But unfortunately, the Movable Type installation docs are not as good as the software itself. So my first blog entry is a tutorial on how to install Movable Type, focusing on the parts that were unclear to me when I was doing it.

My installation of Movable Type is on a Linux server with a MySQL database. If there are issues with other operating systems or databases, they won’t be addressed here. But most of what I describe here will be relevant across platforms.

I’ll start with a list of what files go where (a directory structure that works) and the necessary permissions for the various files. Don’t forget to upload files in the correct mode:

– Everything except the bitmaps must be uploaded in ASCII mode.
– The bitmaps must be uploaded in BINARY mode.

If you don’t upload things in the correct mode, the scripts won’t run and the bitmaps won’t display.

Directory Structure

You will have two Movable Type directories, one containing the program and the other containing the data (your blog entries, and the Movable Type documentation and bitmaps). You need two directories because only script files can go in cgi-bin. Files stored in cgi-bin cannot be viewed or downloaded by visitors, only executed. Don’t be tempted to put the entire installation outside cgi-bin because the limitations are a security feature.

The directories listed below are described relative to the Web site’s home directory. For example, the directory /cgi-bin/ corresponds to a URL like http://www.domain.com/cgi-bin/. When you configure Movable Type, you will need to know the server path to this home directory. If this information isn’t in your server’s control panel, ask your Web host administrator what it is.

Beneath each directory name is a list of what it contains, followed by notes.

Program directory: /cgi-bin/movabletype/
– all files with this filespec: mt*.cgi
– the configuration file: mt.cfg
– these folders: extlib, import, lib, schemas, search_templates, tmpl

Notes:
Set the permissions for all the CGI files to 755.

The “import” directory is something you create; it’s not in the distribution zip.

The “extlib” directory will only contain extensions not already installed on your server, so don’t upload any files or folder to this yet. Just create an empty directory with this name and read on.

Data directory: /movabletype/
– these folders (you manually create them): archives, mt-static

Notes:
The /movabletype/ directory is where current blog entries are stored. Archives are stored in /movabletype/archives/. The Movable Type documentation and bitmaps are stored in /movabletype/mt-static/.

The folders containing blog entries must be writable by the world, so the permissions for /movabletype/, /movabletype/archives/, and all the files within these folders must be set to 777 (full permissions), unless you have special security software running on the server. See the Movable Type documentation for details.

Movable Type docs and bitmaps: /movabletype/mt-static/
– these files: index.html, style.css
– these folders: docs, images

Notes:
The index.html file is mainly there to prevent visitors from viewing the contents of this directory. There is a link on this page to the Movable Type documentation.

The Two Files You Need to Edit

There are two configuration files you will need to edit:
– mt.cfg
– mt-db-pass.cgi

To configure your settings, you need to know:

– server path to your home directory
– server path to your sendmail program
– server path to Perl
– if there is anything in your MySQL installation that differs from the default

If this information isn’t listed in your server’s control panel, ask your Web host administrator.

The other thing you need to do before editing the configuration files is create an empty MySQL database (call it MovableType), and set up a username and password with full permission to access it. Don’t use the same username and password you use to access your Web hosting account; set up a separate one.

Once you have all the information and have created the MySQL database, you are ready to edit mt.cfg. The comments in the file explain almost everything, with the exception of the database settings, which are described in the Movable Type installation docs.

The database section is near the top of the file and contains just one line: “DataSource ./db”. Since you will be using a MySQL database, comment out this line (put a # sign in front of it) and add these three lines in its place:

ObjectDriver DBI::mysql
Database database_name
DBUser database_user

Replace database_name and database_user with the names you set up when you created the database. If you called your database MovableType as I suggested above, the database line will read:

Database MovableType

If your MySQL installation is different from the default in terms of hostname, port, or location of mysql.sock, then you will need one or more of these additional lines (default settings are shown here):

DBHost localhost
DBPort 3306
DBSocket /tmp/mysql.sock

After you’ve finished editing the database settings, go through the rest of mt.cfg slowly and methodically. Read each comment carefully and make a choice; do not skim. If you want the default setting, leave the line for that setting commented out. You only need to uncomment lines when you are changing the default.

When you’re done editing mt.cfg, there is only one more change you need to make: edit the file mt-db-pass.cgi. This file contains a single word, “database_password”, and nothing else. Replace “database_password” with your MySQL password. The password is stored in a separate file for security reasons.

Upload the two edited configuration files to the program directory on the server. If you uploaded these files before and set their permissions, you don’t need to set them again.

How to Know Which of the extlib Files You Need

The files and folders in extlib are extensions that you may already have on your server. You only need to install the ones you don’t have. To find out what you need, point your browser here: http://www.domain.com/cgi-bin/movabletype/mt-check.cgi. This script will check your server, and tell you which extension modules are missing.

In addition to what this script reported, I had to upload the subdirectories “I18N” and “Locale”. I got error messages when they weren’t there.

Run the Installation Script

Now all the files you need are on the server in the correct places, the correct permissions have been set, and the configuration parameters have been specified. So point your browser to this URL:

http://www.domain.com/cgi-bin/movabletype/mt-load.cgi

This script creates the initial Movable Type files, and sets up the database tables. After you have successfully run mt-load.cgi, delete it from the server. It is a serious security risk not to do this.

Configure Movable Type

Now you are ready to log into Movable Type for the first time so you can configure it. Point your browser here:

http://www.domain.com/cgi-bin/movabletype/mt.cgi

This is the administration area. Log in using the default username (Melody) and password (Nelson).

There are two configuration changes that are necessary. Everything else is optional:

– Edit the profile to change the username and password (that’s for security).
– Edit the paths. For some reason, Movable Type does a poor job of guessing and they will be wrong. In general, the string “cgi-bin” should not be in there anywhere.

Now you have a working blog, though you will probably want to change the default appearance and settings. Most of the settings are clearly documented within the program except for the Templates area, which controls the appearance of your blog.

The style presets are not stored within the program itself. They are on the Movable Type Web site here:

http://www.movabletype.org/default_styles.shtml

Copy the style code you want from this page, then paste it into the edit box on the Templates page.

Before you make your blog live, test all the links. It’s very easy to mess up the paths.

I hope this overview is helpful and saves you some time.

14 thoughts on “How to Install Movable Type

  1. I have been hammering away at getting MT working for several days and am now very close. The last remaining hurdle is that the graphics and bitmaps won’t load. They were uploaded as binaries.

    I think that my problem might be the permissions for the directory mt-static, its sub-directories, and the files within them. Your excellent tutorial on installing MT did not specify these permissions. Do you know what those should be? Thanks in advance.

  2. Just learned how to determine if my host is (probably) running cgiwrap or suexec, which it is. I reset the permissions on the directories I referenced earlier to 755. Still don’t get images.

  3. Most likely your problem with the images is paths rather than permissions, since the images don’t need any special permissions.

  4. I’ve tweaked mt.cfg and my directory structure but the pics and docs still won’t load. Here are the highlights of my mt.cfg file as it is configured at this moment. Do you see anything in these entries that would cause the symptom I am describing? Thanks.

    # value when you first install MT; instructions for doing so are in
    # the Installation Instructions, in INSTALLING THE MOVABLE TYPE
    # APPLICATION CODE, Step 3.
    CGIPath /usr/local/www/xxxxxxx/xx/xxx/xx/xx/html/cgi-bin/mt/

    # Configuration for MySQL databases. Add the name of your database
    # and the username that you have for logging in to that database
    # below. The password needs to go in the file mt-db-pass.cgi.
    #
    ObjectDriver DBI::mysql
    Database domain_name_com
    DBUser xxxx
    DBHost localhost
    #
    #
    #
    StaticWebPath /usr/local/www/xxxxxxx/xx/xxx/xx/xx/html/movabletype/mt-static/
    #
    #
    # SendMailPath configuration setting.
    #
    #
    SendMailPath /usr/local/sbin/sendmail
    #
    #
    # being erased. If you do not like this behavior (because it
    # requires you to set directory permissions too loosely, for example),
    # uncomment the following setting.
    #
    NoTempFiles 1
    #
    #
    # change these settings unless you know what they mean, and what they do.
    #
    DBUmask 0022
    HTMLUmask 0022
    UploadUmask 0022
    DirUmask 0022
    #
    #

  5. great! thank you soooo much…the MT docs dont really explain as well as it should…thank you…this really helped me out.

  6. thank you soooooo much, sheryl! i’ve been sweating over the included manual for over a week…finally decided to look for outside help. i’m glad you saw the need! many frustrations relieved 🙂

  7. Thank you for creating this post sheryl.. I thought I had it but… nope. I am still getting this error:

    Bad ObjectDriver config: Connection error: Access denied for user: ‘movtyp@localhost’ (Using password: YES)

    Do you know why this would be?

  8. Hello Sheryl,

    I concur…your information is BY FAR easeier to follow than the install doc.

    I run the mt-check file and am told all is well. I am good to go.

    Running mt-load.cgi gives me the same error.

    Bad ObjectDriver config: Connection error: Access denied for user: ‘movtyp@localhost’ (Using password: YES)

    And my email is set up and double checked!?

    Is there any other reason I would be getting this error?

  9. Sorry…slightly different.

    Bad ObjectDriver config: Connection error: Access denied for user: ‘@localhost’ (Using password: YES)

    Doesn’t pull the name at all in front of localhost.

  10. The installation process changed over time!

    At the moment all you have to do is to make sure that all the source files are uploaded to the server in ASCII mode (excepting /mt-static/ which should be uploaded in BINARY mode).

    Then, you have to edit the file ‘mt-config.cgi’ and set the right CGIPath and StaticWebPath, as well as the mySQL database details (you should create a new database for your movable type installation).

    Last, but not least, you would have to set all your CGI files permission to 755.

Leave a Reply

Your email address will not be published. Required fields are marked *

*