TweetFollow Us on Twitter

Movable Type on Panther

Volume Number: 21 (2005)
Issue Number: 3
Column Tag: Programming

Patch Panel

by John C. Welch

Movable Type on Panther

No Need To Wait For Tiger To Get A Topnotch Blogging System On Mac OS X Server

With all the hoopla about Mac OS X Server 10.4, and all the new tricks it's going to bring as part of the standard installation, I thought I'd take a look at one that's near and dear to my heart, and see about implementing something similar on the current version of Mac OS X Server, namely the Weblog, or "blog" implementation.

Welcome

Now, while Tiger Server will give you a blog as part of the standard installation, there are a number of reasons not to wait for that. For one, while I'm quite sure that Apple's blog setup will be functional and work well for most; it may not be a system that does everything you need it to do. (Everything I've read indicates that Tiger's blog setup will be based on Blojsom, a Java blog implementation.)

Secondly, if you are going to use a blog as a production system, you'll want to test Tiger server out thoroughly before unleashing it on your users. Finally, why wait? There are blog systems that you can run on Mac OS X Server today, and we'll take a look at installing and configuring one of them, namely Movable Type, from Six Apart, (http://www.sixapart.com/), creators of Movable Type, the TypePad blogging service, and new owners of LiveJournal, a public blogging community based on Open Source software.

Why Movable Type?

Well, for a number of reasons. One, I'm familiar with it, as my own website, (http://www.bynkii.com/) is a Movable Type, (Movable Type) based site. (No, I'm not an HTML whiz, which is one reason why I like blogs.) It's quite popular in the Mac world, with sites such as NSLog();, and Daring Fireball among the sites using Movable Type. It can run easily on Mac OS X Server, once you get how to install it, and it can use various databases as a back end, such as BerkeleyDB, MySQL, PostgreSQL, and SQLite.

Movable Type uses CSS and other standard web technologies to create its "look" so if you don't like any of the defaults, you can change it to suit your needs without having to worry about what it will do to various browsers, and almost any web design tool can be used with Movable Type.

Movable Type is well documented, and has a solid API that can be used to extend its featureset a number of ways, including plugins. This is not to say that the other systems aren't just as good, but I had to pick one, and I know Movable Type, so, this is the one we look at.

Getting Movable Type

Getting Movable Type can be a little tedious, but there are a number of license configurations that will work for anyone, from free, to not ridiculously expensive, depending on the number of blogs and authors you want. Note that with Movable Type, if you have separate blogs that all fall under the same root domain, (such as those I use for the various sections of Bynkii.com), that's considered a single blog as far as licensing is concerned. Go to http://www.sixapart.com/movabletype/pricing, and pick the configuration that works best for you.

Once you've selected your licensing configuration, download the full install of the latest version of Movable Type, 3.15 as of this article. (You'll have to get a free TypePad ID to get Movable Type, but in my experience, Six Apart has yet to spam me, or email me at all for that matter, and I've been using Movable Type for a little over two years now.) You select the format you want, .tar.gz or .zip, and download it to your Mac, either the server you'll be running it on, or an administration station. Expand the archive, and then immediately navigate into the docs subdirectory, and open mtinstall.html in a browser. This contains the primary installation documentation, and you will want to be quite familiar with it. Almost every problem I've ever had with a Movable Type installation on Mac OS X Server is either due to not paying attention to the directions, or Apple's changes to a standard Apache install.

Installing Movable Type

Okay, so we've read the instructions, and we're going to set up Movable Type on our Mac OS X box. To keep things simple for this article, we're going to use the BerkelyDB as the back end. This is where things get a little odd thanks to Apple's...unique take on Apache directory setups. First, you want to ensure that Perl is in the right place, since Movable Type makes heavy use of Perl. Open a command line window in terminal and run "which perl" The answer should be /usr/bin/perl, as that's the normal place that Mac OS X puts it. If you've modified your perl location, follow the Movable Type instructions on changing the CGI files so they know where to look.

We're going to install the Movable Type CGI files into Apple's cgi-bin directory, so we'll want to create an mt-static directory in the main web documents directory. For our example, we'll use /Library/WebServer/Documents/. You can have this directory anywhere along with your actual non - CGI files, but again, we're keeping it simple. We're going to put all the CGI files into the default CGI location, /Library/WebServer/CGI-Executables/.


Site Settings for Movable Type

However, before we do any of this, we want to make sure that the Web services for this site in Mac OS X Server are set correctly. Start up Server Admin, and select the Web settings. Go to the lower Settings tab in Web services, and select the sites tab. Open up the site you're going to use for your Movable Type installation, and under options, enable "CGI Execution" and disable "Performance Cache". You'll also want to go into the Modules tab and make sure that the perl_module and php_modules are enabled, since Movable Type uses both. Save those changes, and exit Server Admin.

In terminal, (you can do all of this in the Finder, or even via SFTP, but in the end, terminal ends up being a more direct and simpler way to set up Movable Type.), cd to /Library/Documents/ and create a directory named mt-static. Set the permissions so owner and group have full permissions, everyone else has read and execute only, i.e. chmod 775 mt-static. Then copy the following items into this folder, as per the Movable Type installation instructions, (which, since you read them thoroughly before starting, you already know to do this.)

  • The mt.js file
  • The styles.css file
  • The docs folder
  • The images folder

Once those are in mt-static, I set the permissions for them as follows, (Note: This is for a server that only talks to internal clients. If this server will be exposed to the public Internet, you will want to set your permissions more restrictively):

  • mt.js to full permissions for owner and group, read and execute only for all others (chmod 775)
  • styles.css to read & write for owner and group, read only for all others (chmod 664)
  • The contents of the docs folder to read & write for owner and group, read only for all others (chmod 664)
  • The docs folder itself to full permissions for the owner and group, read and execute only for all others (chmod 775)
  • The contents of the images folder to read & write for owner and group, read only for all others (chmod 664)
  • The images folder itself to full permissions for the owner and group, read and execute only for all others (chmod 775)

Finally, set the owner and group for mt-static and all its contents to www, the web server user used by Mac OS X's web services. (chown -R www:www mt-static/) Now that we have mt-static taken care of, let's go set up the meat of Movable Type, the cgi directory.

Change directory to /Library/WebServer/CGI-Executables, the default CGI directory for Mac OS X Server. Create a directory called mt and change directory into that. (Note: you can just dump all the CGI files into /Library/WebServer/CGI-Executables, but I like to give them their own directory. It makes it easier to keep track of what CGI files are attached to what, and reduces the chance of a random other CGi file overwriting your Movable Type CGI files.)

Now, copy all the Movable Type files, (that you didn't copy into mt-static) into this mt directory. (Those of you who are more observant will note that we are doing things out of order of the Movable Type installation instructions. This doesn't make a difference in the end. I happen to prefer uploading, then configuring. If you like to configure, then upload, that works too.)

Change the permissions of all the files ending in .cgi in the mt directory to full permissions for the owner, read and execute only for everyone else. (chmod 755 *.cgi) Since we are going to use the BerkeleyDB, we have to create a directory for those files. Create a directory in mt called db, and set the permissions to full access for everyone. (chmod 777 db) Now, lets create the directory for our first weblog files. Again, by partitioning each blog's files into their own directory, we make our lives a lot simpler later on. So, cd back to /Library/WebServer/Documents/ create a directory, and call it firstblog. Inside of this directory, create another directory called archives. Set the permissions of firstblog and it's contents so that owner and group have full permissions and everyone else only has read and execute. (chmod -R 775 firstblog) Then change its ownership to www for the user and the group. (chown -R www:www firstblog). Congratulations, the initial installation of Movable Type is finished. Change directory back to /Library/WebServer/CGI-Executables/mt, and we can start configuring Movable Type.

Initial Movable Type Configuration

In the editor of your choice, open the /Library/WebServer/CGI-Executables/mt/mt.cfg file. I use pico with the -w switch to avoid line wrap issues, but you can use any decent text editor, such as BBEdit, TextWrangler, or SubEthaEdit.

The first thing we want to set is the CGIPath for Movable Type. This will let Movable Type know where to start looking for its CGI files. This is not the physical disk path to them, but the path you'll see as a URL for our setup, it's going to be:

http://fulldnsnameorIPaddressofserver/cgi-bin/mt/

(This is where you run into one of Apple's Apache Oddities. Yes, the CGI directory is called "CGI-Executables". Ignore that, for down that path lies madness. If you look at the Apache configuration file, httpd.conf in /etc/httpd/, you'll see this line:

ScriptAlias /cgi-bin/ "/Library/WebServer/CGI-Executables/"

Which tells Apache that the CGI-Executables directory is really the root cgi-bin directory. So even though it seems really wrong, we assume /cgi-bin/ to be /Library/WebServer/CGI-Executables/. Confusing? Yep. Nonstandard? Yep. Is it worth redoing the entire Apache setup for this? Probably not.) So your CGIPath line should look like:

CGIPath http://fulldnsnameorIPaddressofserver/cgi-bin/mt/

Next, we set the path to our db directory. Since this is a physical disk path, not a virtual HTTP path, we use the "real" path to the db directory, namely:

/Library/WebServer/CGI-Executables/mt/db

Put that in as the path for the DataSource line in mt.cfg, so it looks like this:

DataSource /Library/WebServer/CGI-Executables/mt/db

The next thing we need to set is the path to our mt-static directory and its files. This is a HTTP path, and can be relative from the root of the web documents directory, so we just set StaticWebPath to:

StaticWebPath /mt-static/

That's the minimal configuration to get Movable Type working. However, there are a couple of things that I like to set as well. First, for email notifications of things like comments and trackbacks, I set my mail transfer to smtp and then set my mail server. (Note: You can also just use sendmail locally if you want, but I prefer to use SMTP, since that way, if I change my mail server's machine, I don't have to change my Movable Type settings. It gives me a little more flexibility without a lot of work. So I uncommented the MailTransfer and SMTPServer lines, and set SMTPServer to my mail server: (Obviously, you'll want to set this to your mail server)

MailTransfer smtp
SMTPServer fulldnsname.ofyourmailserver.here

That's pretty much it for mt.cfg. So save your changes and closet that file. Don't think that we've fully configured Movable Type by a long shot. If you take the time to read the mt.cfg file thoroughly, there are a lot of ways you can really tweak Movable Type's setup and performance, so that it works the way you want it to.

Now, we start doing the web configuration of Movable Type. First, we're going to want to check for the available Perl modules. To do this, we use the mt-check.cgi file. So go to:

http://yourwebserver/cgi-bin/mt/mt-check.cgi.

(Note: Yes, I know that the Movable Type instructions don't tell you to put the "cgi-bin" directory in the path when you're running these CGIs. It's been my experience that you have to, so I just do it and move on. You can probably fix this if you want, but I haven't had a real reason to yet.) You should get a page with a list of configuration information, listing the Perl modules that Movable Type could find. By default, Mac OS X Server should have all the requisite modules installed. It won't always have all the optional ones, but you can always install those later. The important thing is that you get the "Movable Type System Check Successful" message at the bottom of your screen. If not, go back and make sure that you installed all the files to their correct places, set your permissions right, and that mt.cfg is pointing to the right places.

The next step is to initialize the system. This is the make - or - break test for your setup. If you get past this step, then you've got your basic installation and config done. Go to:

http://yourwebserver/cgi-bin/mt/mt-load.cgi.

If you set up everything correctly, then you get the System Initialization Complete message, and dire warnings to delete the mt-load.cgi file. I recommend listening to these dire warnings. However, since we've all been careful, this step works great, and we can now log into Movable Type, and set up our first weblog.

Configuring Movable Type's Web Interface

Go to:

http://yourwebserver/cgi-bin/mt/mt.cgi

This is the main URL for administering your Movable Type setup, so you'll want to bookmark it. The initial userID and password you use is Melody for the userID, and Nelson for the password. Once you've logged in, you'll see the initial Movable Type administration screen.


Initial Movable Type Administration Screen

Obviously, you're going to want to create a new weblog author, and give that author full control over your installation, and that default weblog. Once that's done, log out, then log back in as the new author, and edit Melody's permissions so she can't do anything. Unfortunately, you can't delete her, so we'll just cripple her thoroughly. Next we're going to modify that initial weblog so it matches what we want out of it. On the main menu screen, in the "First Weblog" section, click on "configuration".

That will bring you to the "Core Setup" screen, and we can commence changing this to reflect our setup.

  • Change the "Weblog Name:" to whatever you like. This will be the title of the blog for readers, and in the main administration screen.
  • Change the "Local Site Path:" to /Library/WebServer/Documents/firstblog, so that all your blog files are in that firstblog directory we created earlier.
  • Set the "Site URL:" to http://yourwebserver/firstblog/. This will be the URL for people wanting to read your blog.
  • Set the "Local Archive Path:" to /Library/WebServer/Documents/firstblog/archives. This is the physical disk path to the directory in firstblog that will hold the archives of your blog entries.
  • Set the "Archive URL:" to http://macservertest.kclife.net/firstblog/archives/. This will be the base URL for all your entry archives.
  • Finally, set the "Timezone:" to whatever your local Timezone is.
  • Click the "Save Changes" button.

This page will refresh with a new addition, a button that says "Rebuild my site". With Movable Type, the biggest annoyance is the site rebuilding. The current version gives you some ways to avoid this, but you may as well get used to it.


Core Setup screen with rebuild button

Clicking the "Rebuild my site" button will bring up the Rebuild window, shown below. Hit the Rebuild button, and your initial config is now set.


Rebuild Window

Again, there are a ton of configuration options here, but you now have Movable Type basically set up so you can commence to blogging, so, how about we create our first entry?

First Entry

If you look at the column on the left hand side of the "Core Setup" screen, you'll see a link for "New Entry" Click on that, and you'll get the "Create New Entry" screen, seen below.


Movable Type New Entry screen

As you can see, there are quite a few options here, and I'm not going to go over all of them. The online help for Movable Type is excellent, and you should get in the habit of using it as early as possible. Most of the options are pretty self - explanatory. The few I'll point out are that "Entry Body" is what you see below the title on the blog on the main page. "Extended Entry" is what you see when you click on the "continue reading..." links at the bottom of the Entry Body. Use of the Extended Entry is entirely up to you. You don't ever have to use it if you don't want to. The other thing that can catch you off guard is the "Post Status". If you leave it on "Draft", you'll never see your entries on your blog. So, once you're ready to publish your wisdom and wit to the blog, change the "Post Status" to "Publish and hit "Save". Within seconds your entry will be posted, and that's it, you're blogging on Mac OS X Server, even without Tiger.

Conclusion

Obviously, I haven't even begun to touch on all the ways you can customize your blog via custom templates, changing the CSS stylesheets, adding your own stylesheets, etc. There are tons of plugins out there, everything from anti-spam to drop caps for your entries, and you can find all of them on Six Apart's site. If you're going to have your blog on the public Internet, the anti-spam plugins are essentially a necessity, and Movable Type provides one of the better ones, Movable Type-Blacklist, by default. Finally, you don't have to just use Movable Type's "New Entry" screen. There are a multitude of blog editors out there, free and shareware. I personally use ecto, available at http://ecto.kung-foo.tv/. It's not free, but it's one of the best, and has an excellent feature set.

One final note: Blogs aren't just for fun/personal sites. I use them at my "real" job as a way of keeping track of what I'm working on and documenting it as well. There's nothing nicer than having a searchable, easily accessible documentation source that allows for rich text, images, even movies. I find that blogs have made my life as a sysadmin much easier. Simply by giving me a way to keep track of information in a location that is not the ridiculously cluttered top of my desk. So regardless of when Tiger shows up, Mac OS X Server is a great platform for blogging on any level.


John Welch (jwelch@bynkii.com) is an IT Staff Member for Kansas City Life Insurance, a Technical Strategist for Provar, (http://www.provar.com/) and the Chief Know-It-All for TackyShirt, (http://www.tackyshirt.com/. He has over fifteen years of experience at making Macs work with other computer systems. John specializes in figuring out ways in which to make the Mac do what nobody thinks it can, showing that the Mac is a superior administrative platform, and teaching others how to use it in interesting, if sometimes frightening ways. He also does things that don't involve computertry on occasion, or at least that's the rumor.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more
New promo at Visible: Buy a new iPhone, get $...
Switch to Visible, and buy a new iPhone, and Visible will take $10 off their monthly Visible+ service for 24 months. Visible+ is normally $45 per month. With this promotion, the cost of Visible+ is... Read more
B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for $100 off Apple’s new MSRP, only $899. Free 1-2 day delivery is available to most US addresses. Their... Read more
Take advantage of Apple’s steep discounts on...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.