June 23, 2005
Comment Spam and Installing MT-Scode on OS X
Recently I've been getting a lot of comment spam. It ironic because I haven't even written anything lately. The truth is I've been distracting myself with installing Debian Sarge on my old Dell and I recently decided to pick up Objective-C and Cocoa programming. Needless to say, its frustrating that the only time I've been spending with my blog is removing comments about onl1ne gam6ling and pr0n. Porting the blogs hosted on my box to another platform was something that I didn't want to consider and my choices for solving this problem while keeping movable type 2.x.x were limited. I found mt-scode and now that its running I think it will solve the problem better then banning IPs or using mt-blacklist. However getting it to work on OS X 10.3.9 was a challenge.
The crux of the problem was getting GD.pm installed. My first attempt was to do it with the command line and cpan:
joshua% sudo cpan
Password:
cpan shell -- CPAN exploration and modules installation (v1.76)
ReadLine support enabled
cpan> install GD::Simple
...
[lots of make output]
...
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
|
Argh! Lets see what went wrong:
- I'm missing a bunch of libraries
- the libraries I do have that it needs are in /sw/lib not /usr/lib
- its choking on font errors
So since I'm a sadomasochist I decide to install the missing libraries with fink, point cpan to /sw/lib and try again. Basically, less errors but the same result. I'm starting to think cpan is right and "install seems impossible." But it somehow seems less painful to figure this out, than to keep ahead of the comment spam, so I take a different direction and decide to check if GD.pm is available in fink. Why didn't I think of this in the first place? I guess I've had all good experiences with cpan since I followed Jeremy Mates' articles, life with cpan and cpan on Mac OS X.
Fink installed GD without a hitch but I cant get mt-scode to find it. Time to do some debugging. The 500 Server Internal Error is not very helpful so I open mt-scode.cgi and add this to the top:
use CGI::Carp qw(fatalsToBrowser); |
Now it tells me that GD.pm in not in the @INC path and when I check the fink directories I realize its right. Why did fink decide to put it in /sw/lib/perl5/5.8.6/darwin-thread-multi-2level and not the other directories in /sw that are in @INC? Who knows. I made some symbolic links but now it complains there are too many layers of links. Argh again! The final solution is to add "push (@INC, '/sw/lib/perl5/5.8.6/darwin-thread-multi-2level');" to the BEGIN block in mt-scode.cgi like this:
my($MT_DIR); BEGIN { if ($0 =~ m!(.*[/\\])!) { $MT_DIR = $1; } else { $MT_DIR = './'; } unshift @INC, $MT_DIR . 'lib'; unshift @INC, $MT_DIR . 'extlib'; # GD Hack for fink push (@INC, '/sw/lib/perl5/5.8.6/darwin-thread-multi-2level'); } |
And voila!
Technorati tags: howto, how to, tutorial, install guide, mt, movabletype, movable type, mtscode, spam, commentspam, comment spam, blog, blogs, blogging, osx, os x, perl, cpan, finkPosted by joshua at June 23, 2005 9:36 PM | TrackBack
Great site with good tips on movableType with Scode. I ran the scodetest.cgi and everything look good. However, I can't seem to get the image to display. If i paste the url of http://www.mysitename.com/blog/mt-scode.cgi?code=8 I get this error:
The image "http://www.mysitename.com/blog/mt-scode.cgi?code=8" cannot be displayed, because it contains errors.
Please help, I am pulling my hair out trying to sloved this. My platform is:
Mac OS X(panther) or (tiger) - tried it on both
gd-2.0.33
movableType 3.17
Thank you in advance.
Posted by: phil at August 17, 2005 4:27 PM