ImageMagickのインストール

最近のブログのコメント欄にはCAPTCHAという認証用の画像が入っています。これはスクリプト系スパム対策の為に効果がありMT4では標準搭載されているのでぜひ使いたいと思います。そうすればコメントを一旦保留にしていちいちスパム判断しなくて済むし…。
そのためにはImageMagickとPerlのImage::Magickが必要になりますのでインストールします。

パッケージの入手先
ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.2-9.tar.gz

展開
# cd /usr/local/src/
# tar zxf ImageMagick-6.3.2-9.tar.gz

# cd /usr/local/src/ImageMagick-6.3.2

# setenv CPPFLAGS -I/usr/local/include
# setenv LDFLAGS -L/usr/local/lib
上記2行はlibjpeg.aとjpeglib.hを読み込むためにパスを通します。
PHPのように./configureでjpegライブラリのパスを指定できると思ったのにそんなオプション無かったのでこの方法をとりました。ImageMagickには別途jpegライブラリが必要のようです。PHPでGD有効にしていれば入ってるはずです。

# ./configure –enable-lzw=yes
lzwはLZW圧縮のことで要するにGIFです。

# make
# make install

ここでImageMagickのインストールは完了。
次にPerl用モジュールを組み込みます。

# cd /usr/local/src/ImageMagick-6.3.2/PerlMagick
# perl Makefile.PL
# make
# make install

これでMOVABLE TYPEでCAPTCHAが使えるようになります。

 

無線LANについてdmesgで見ると

今までも出ていたようなので気にしなかったのですが接続するときに下記のようなメッセージが出ています。

Error for wireless request “Set Mode” (8B06) :
SET failed on device eth1 ; Operation not supported.
Error for wireless request “Set Frequency” (8B04) :
SET failed on device eth1 ; Device or resource busy.

いったい何なのかググってみるとdmesgで確認したら?といった感じで(英語サイト)あったのでdmesgをとってみたら驚愕。
eth0: Hardware identity 8013:0000:0001:0000
eth0: Station identity 001f:0006:0001:0003
eth0: Firmware determined as Intersil 1.3.6
eth0: Ad-hoc demo mode supported
eth0: IEEE standard IBSS ad-hoc mode supported
eth0: WEP supported, 104-bit key
eth0: MAC address (ここに無線LANのMACアドレス)
eth0: Station name “Prism I”
eth0: ready
eth0: orinoco_pci at 0000:02:05.0
ADDRCONF(NETDEV_UP): eth0: link is not ready
ADDRCONF(NETDEV_UP): eth0: link is not ready
e100: eth0: e100_watchdog: link up, 100Mbps, full-duplex
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
eth0: no IPv6 routers present

e100: eth1: e100_probe: addr 0xc0200000, irq 11, MAC addr (有線LANのMACアドレス)
ADDRCONF(NETDEV_UP): eth1: link is not ready
eth1: New link status: Connected (0001)
ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
eth1: no IPv6 routers present
eth1: Error -110 disabling MAC port

本来有線LANのはず、というか有線LANとして利用できているeth0に無線LANの設定が書かれていて、無線LANになるはずのeth1は有線LANのMACアドレスが書かれている。どーゆことですか?これ orz…

DBD-mysqlのインストール

昨日のMT4BETAのインストールですっかりPerlにMySQLコネクタをインストールし忘れていたので今度BETA4を入れる前までに用意します。

# mv DBD-mysql-4.005.tar.gz /usr/local/src/
# cd /usr/local/src
# tar zxf DBD-mysql-4.005.tar.gz
# cd DBD-mysql-4.005

ここまではいつも通りの前準備

まずPerlコマンドを利用してMakefileを作成します。
# perl Makefile.PL

Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 76.

Cannot find the file ‘mysql_config’! Your execution PATH doesn’t seem
not contain the path to mysql_config. Resorting to guessed values!
Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 466.
Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 466.
Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 466.
Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 466.
Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 466.
Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 466.
Failed to determine directory of mysql.h. Use

perl Makefile.PL –cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section “C Compiler flags” or type

perl Makefile.PL –help

…う、mysql_configへパスを通してなかったorz。

# find / -name mysql_config
/usr/local/src/mysql-5.0.18/scripts/mysql_config
/usr/local/mysql/bin/mysql_config

.cshrcを確認
set path=(/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin)

以上より一時的に/usr/local/mysql/binをPATHに追加

set path=(/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin /usr/local/mysql/bin)

後はmakeとmake installで完了です。
# make
# make install