May 29, 2005

Katie will blog soon... was hindered by Movable Type 3.16 bug

Katie's joining the blogging community... for a test run. I've been badgering her about blogging for a while. Telling her about all the fame and fortune I've received by having my own blog. So she has finally agreed to give it a shot (probably because she got a new digital cam courtesy of me... a canon S500). I told her that if she likes blogging, I'll buy her a domain name and some hosting somewhere. Until that time, she can share my domain at katie.jojometal.com. She sounded excited about the idea so I went ahead and created the subdomain (thanks to liquidweb's cpanel which automates the process), and got to installing Movable Type 3.16.

I started setting everything up, ran the mt-load script and got all the db tables loaded and changed the mt.cfg file and all that garbage. So, I was ready to login for the first time and customize things a bit before I let her run amok.

Well, the repetitive login nightmare I had from my hosting change and previous movable type upgrade was back. I was forced to login each time I clicked any link in the admin page and couldn't see any images. So, quite confident, I looked at my mt.cfg file, only to find that I did have a trailing slash. So that wasn't the problem even though the symptoms were exactly the same.

After a good amount of searching, I found an article saying that Movable Type 3.16 had a bug which removes the trailing slash if you install it in the root directory of any domain (or subdomain). Well, I applied the patch, correcting two lines of code in the App.pm file and the login problem went away. However, I was still left with the missing images problem. (More info on this patch here. The minus sign indicates that you should replace this line with the line beginning with a plus).

I waded through a sea of craptacular information on subdomains and .htaccess files and tried quite a few things before I finally figured out what to do. Copy what I'd done before... it was that simple. In my .htaccess file I added the lines:

RewriteCond %{HTTP_REFERER} !^http://katie.jojometal.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://katie.jojometal.com$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

To tell you the truth, I have no idea what this does anymore, as I wrote the htaccess file originally back in November of last year. It looks like it just redirects any subdirectory of the subdomain to the correct folder. Anyways, it turns out that I'd done this for all other subdomains, so I could've just copied and pasted at the beginning and been done with it.

So, here's a quick guide for myself or anyone else when installing a new MT installation.

Upload.
CHMOD all cgi files to 755.
Change mt.cfg file.
Change db password file.
Upload db password and mt.cfg.
Run mt-load.cgi
If the installation is a subdomain, create subdomain and add the three lines in this post to the .htacces file
Login to mt.cgi...and hopefully that should be it.
Change Melody user to new username/pass.

Posted by Jordan at May 29, 2005 5:51 AM | TrackBack


Post a comment

If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.