2007/05/31 11:47MySQL 5.0.41

MySQL 5.0.41がリリースされたのでKAJUKAJU.netのMySQLもバージョンアップ。

$ wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.41.tar.gz/from/http://ftp.iij.ad.jp/pub/db/mysql/
$ tar xvzf mysql-5.0.41.tar.gz
$ cd mysql-5.0.41
$ ./configure --prefix=/usr/local/mysql --localstatedir=/data/mysql --with-charset=ujis --with-extra-charsets=all --with-mysqld-user=mysql
$ make
# make install

MySQLを再起動。

# /sbin/service mysql restart
Shutting down MySQL... SUCCESS!
Starting MySQL. SUCCESS!

2007/05/30 17:51MovableType FastCGI対応

KAJUKAJU.netで動いているMovableTypeはチューニングをしていないので普段の閲覧時は気がつかないが、新規投稿やコメント投稿時の動作が遅い。
チューニング方法としてはcgiの高速化がある。
 ・mod_perl2
 ・SpeedyCGI
 ・FastCGI
MovableTypeは3.4以降のバージョンでFastCGIの対応がされたらしい。
今回はFastCGI化にチャレンジする。
FastCGIはApacheのモジュールとして組み込むので候補は「mod_fastcgi」と「mod_fcgid」。
前者はかなり前からアップデートしていないので現在でも更新されているmod_fcgidを使う。
ちなみにWebサーバはApache 2.2.4です。
まずはmod_fcgidをインストールする。
※Apacheが/usr/local/apache2にインストールされていない場合はMakefileを編集する必要がある。

$ wget http://nchc.dl.sourceforge.net/sourceforge/mod-fcgid/mod_fcgid.2.1.tar.gz
$ tar xvzf mod_fcgid.2.1.tar.gz
$ cd mod_fcgid.2.1
$ make
# make install

Apacheの設定変更をする。
/usr/local/apache2/conf/httpd.conf

LoadModule fcgid_module       modules/mod_fcgid.so
<IfModule mod_fcgid.c>
SocketPath /tmp/fcgid_sock/
AddHandler fcgid-script .fcgi
</IfModule>

FastCGIが実行される場所を準備する。

# mkdir /tmp/fcgid_sock
# chmod 777 /tmp/fcgid_sock

MovableTypeの設定を変更する。
/usr/local/MovableType/mt-config.cgi

##### FastCGI #####
AdminScript     mt.fcgi
CommentScript   mt-comments.fcgi
TrackbackScript mt-tb.fcgi
SearchScript    mt-search.fcgi
XMLRPCScript    mt-xmlrpc.fcgi
LaunchBackgroundTasks 0

FastCGI対応させるファイルをリネームする。

# mv mt-config.cgi mt-config.fcgi
# mv mt-comments.cgi mt-comments.fcgi
# mv mt-tb.cgi mt-tb.fcgi
# mv mt-search.cgi mt-search.fcgi
# mv mt-xmlrpc.cgi mt-xmlrpc.fcgi

これでhttpdを再起動すればOK。

2007/05/10 14:40Postfix 2.4.1

Postfix 2.4.1がリリースされたのでKAJUKAJU.netのPostfixもバージョンアップ。

$ wget http://mirror.postfix.jp/postfix-release/official/postfix-2.4.1.tar.gz
$ tar xvzf postfix-2.4.1.tar.gz
$ cd postfix-2.4.1
$ make
# make upgrade
# /sbin/service postfix restart
postfix を停止中:                                          [  OK  ]
postfix を起動中:                                          [  OK  ]

2007/05/09 14:23PHP 5.2.2

PHP 5.2.2がリリースされたのでKAJUKAJU.netのPHPもバージョンアップ。

$ wget http://jp.php.net/get/php-5.2.2.tar.bz2/from/this/mirror
$ tar xvjf php-5.2.2.tar.bz2
$ cd php-5.2.2
$ ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-zlib --with-gd --enable-mbstring --enable-mbregex --disable-ipv6
$ make
# make install

インストール後にApacheを再起動する。

# /sbin/service httpd restart
httpd を停止中:                                            [  OK  ]
httpd を起動中:                                            [  OK  ]

2007/05/07 19:49BIND 9.4.1

BIND 9.4.1がリリースされたのでKAJUKAJU.netのBINDもバージョンアップ。

$ wget http://ftp.isc.org/isc/bind9/9.4.1/bind-9.4.1.tar.gz
$ tar xvzf bind-9.4.1.tar.gz
$ ./configure --disable-ipv6 --sysconfdir=/etc
$ make
# make install
# /sbin/service named restart
named を停止中:                                            [  OK  ]
named を起動中:                                            [  OK  ]

2007/05/02 10:15fmlでWarning

MLにメールを出すたびにfmlのログにWarningが出ている。
内容はFromとReturn-Pathが同じかをチェックしている部分なんだけどFromを書き換えているため意味がない。

# tail /var/spool/fml/mkname/log
07/05/02 10:00:49 MTI[1517]: Warning; Return-Path:<owner-mlname@kajukaju.net> != From: (メールアドレス)

fmlの設定でこのチェックを無効にしてしまいます。

# vi /usr/local/fml/libmti.pl
## additonal checks
## 1 check the consistency between Return-Path: and From:
#if ($rp && $From_address && !&AddressMatch($rp, $From_address)) {
#   &Log("MTI[$$]: Warning; Return-Path:<$rp> != From:");
#}

09:45fml

メーリングリストサーバをfmlで構築しました。
主に携帯電話でのやりとりなので携帯用の設定を追加して構築。
通常のML作成の後にconfig.phにいくつか追記するのがポイントです。
こうすることでFromアドレスが書き換えられるので携帯での返信動作も可能になります。

$ vi /var/spool/fml/mlname/config.ph
# YOU CAN EDIT MANUALLY AFTER HERE.
# FOR SECURITY, Disable user to retrieve member list
# fml 3.0 style
# @DenyProcedure = ('member','active','members','actives','status','stat');
#
# fml 4.0 style
&DENY_PROCEDURE('member');  # _this_line_is_added_by_makefml_
&DENY_PROCEDURE('active');  # _this_line_is_added_by_makefml_
&DENY_PROCEDURE('members'); # _this_line_is_added_by_makefml_
&DENY_PROCEDURE('actives'); # _this_line_is_added_by_makefml_
&DENY_PROCEDURE('status');  # _this_line_is_added_by_makefml_
&DENY_PROCEDURE('stat');    # _this_line_is_added_by_makefml_
$START_HOOK = q#
$Envelope{'Body'} = "From <". $From_address .">\n\n". $Envelope{'Body'};
#;
$HEADER_ADD_HOOK = q#
&DELETE_FIELD('X-ML-Info');
&DELETE_FIELD('List-Id');
&DELETE_FIELD('List-Software');
&DELETE_FIELD('List-Post');
&DELETE_FIELD('List-Owner');
&DELETE_FIELD('List-Help');
&DELETE_FIELD('List-Unsubscribe');
#;
$SMTP_OPEN_HOOK = q#
$Envelope{'fh:from:'} = $MAIL_LIST;
$Envelope{'fh:reply-to:'} = $MAIL_LIST;
#;
1;

2007/04/27 18:28CentOS 5

RHEL5のリリースに伴ってCentOS5がリリースされたらしい。
yumでCentOS4からCentOS5にアップグレードしてみようかねぇ。

#rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-5-0.0.el5.centos.2.i386.rpm
# yum clean all
# yum --disablerepo=* --enablerepo=base --enablerepo=updates update yum* rpm*
# yum clean all
# yum --disablerepo=* --enablerepo=base --enablerepo=updates upgrade

2007/04/26 11:31SpamAssassin 3.1.8



先日のメモリ不足の件はどうやらSpamAssassinの脆弱性によるものらしい。
SpamAssassinのサイトに情報があった(CVE-2007-0451)。
これによると長いURLを含むメールの処理に問題があってDoSを引き起こされるらしい。
SpamAssassinを3.18にアップデートした。

$ wget http://ftp.kddilabs.jp/infosystems/apache/spamassassin/source/Mail-SpamAssassin-3.1.8.tar.bz2
$ tar xvjf Mail-SpamAssassin-3.1.8.tar.bz2
$ perl Makefile.PL PREFIX=/usr/local/
$ make
# make install
# /sbin/service spamd restart
spamd を停止中:                                            [  OK  ]
spamd を起動中:                                            [  OK  ]

これでしばらく様子見かな。
ちなみにDoSが発生したときのMRTG(上:CPUロードアベレージ、下:メモリ使用量)。
http://spamassassin.apache.org/advisories/cve-2007-0451.txt

2007/04/21 22:13Out of Memory

今日の夕方ごろサーバでメモリ不足が発生していろいろなプロセスがダウンした様子。

# cat /var/log/kernel.log
Apr 21 15:41:12 bruna kernel: Out of Memory: Killed process 18377 (httpd).
Apr 21 15:44:24 bruna kernel: oom-killer: gfp_mask=0x1d2
Apr 21 15:47:22 bruna kernel: Mem-info:
Apr 21 15:50:02 bruna kernel: DMA per-cpu:
Apr 21 15:51:45 bruna kernel: cpu 0 hot: low 2, high 6, batch 1
Apr 21 15:55:51 bruna kernel: cpu 0 cold: low 0, high 2, batch 1
Apr 21 15:58:38 bruna kernel: Normal per-cpu:
Apr 21 16:01:57 bruna kernel: cpu 0 hot: low 32, high 96, batch 16
Apr 21 16:05:33 bruna kernel: cpu 0 cold: low 0, high 32, batch 16
Apr 21 16:27:28 bruna kernel: HighMem per-cpu: empty
Apr 21 16:27:40 bruna kernel:
Apr 21 16:28:13 bruna kernel: Free pages:         716kB (0kB HighMem)
Apr 21 16:28:23 bruna kernel: Active:78523 inactive:41040 dirty:0 writeback:0 unstable:0 free:179 slab:3440 mapped:120491 pagetables:2484
Apr 21 16:28:24 bruna kernel: DMA free:20kB min:20kB low:40kB high:60kB active:10944kB inactive:176kB present:16384kB pages_scanned:1043258
all_unreclaimable? yes
Apr 21 16:28:24 bruna kernel: protections[]: 0 0 0
Apr 21 16:28:24 bruna kernel: Normal free:696kB min:696kB low:1392kB high:2088kB active:303148kB inactive:163984kB present:507776kB pages_s
canned:20751918 all_unreclaimable? yes
Apr 21 16:28:24 bruna kernel: protections[]: 0 0 0
Apr 21 16:28:24 bruna kernel: HighMem free:0kB min:128kB low:256kB high:384kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unrec
laimable? no
Apr 21 16:28:24 bruna kernel: protections[]: 0 0 0
Apr 21 16:31:22 bruna kernel: DMA: 1*4kB 0*8kB 1*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 20kB
Apr 21 16:31:23 bruna kernel: Normal: 10*4kB 2*8kB 0*16kB 4*32kB 0*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 696kB
Apr 21 16:31:23 bruna kernel: HighMem: empty
Apr 21 16:31:23 bruna kernel: Swap cache: add 322507, delete 322506, find 568501/595776, race 0+46
Apr 21 16:31:23 bruna kernel: 0 bounce buffer pages
Apr 21 16:31:23 bruna kernel: Free swap:            0kB
Apr 21 16:31:23 bruna kernel: 131040 pages of RAM
Apr 21 16:31:23 bruna kernel: 0 pages of HIGHMEM
Apr 21 16:31:23 bruna kernel: 2182 reserved pages
Apr 21 16:31:23 bruna kernel: 24199 pages shared
Apr 21 16:32:32 bruna kernel: 1 pages swap cached

こんな感じのログがわらわら出ていました。
死んだプロセス一覧。

# cat /var/log/kernel.log |grep "Out of Memory"
Apr 21 15:41:12 bruna kernel: Out of Memory: Killed process 18377 (httpd).
Apr 21 16:32:32 bruna kernel: Out of Memory: Killed process 18378 (httpd).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18379 (httpd).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18380 (httpd).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18381 (httpd).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18388 (httpd).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18454 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18347 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18407 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18455 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18387 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18342 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18451 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18431 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18418 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18489 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18504 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18416 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18487 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18372 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18417 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18386 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18474 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18490 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18498 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18469 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18470 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18466 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18443 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18364 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18511 (mt-tb.cgi).
Apr 21 16:48:41 bruna kernel: Out of Memory: Killed process 18421 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18420 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18368 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18419 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18398 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18425 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18429 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18453 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18522 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18432 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18452 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18515 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18568 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18520 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18499 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18537 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18433 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18403 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18389 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18370 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18401 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18565 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18546 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18435 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18391 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18480 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18461 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18510 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18392 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18479 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18442 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18531 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18467 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18400 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18458 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18468 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18519 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18488 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18523 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18444 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 11822 (httpd).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18501 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18496 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18502 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18521 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18497 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18558 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18587 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18574 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18573 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18383 (mt-tb.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 8949 (spamd).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18665 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18663 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18664 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18667 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18666 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18662 (mobile.cgi).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 3670 (httpd).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18527 (smtpd).
Apr 21 16:48:42 bruna kernel: Out of Memory: Killed process 18529 (anvil).
Apr 21 16:48:43 bruna kernel: Out of Memory: Killed process 18692 (mobile.cgi).
Apr 21 16:48:43 bruna kernel: Out of Memory: Killed process 18685 (httpd).
Apr 21 16:48:43 bruna kernel: Out of Memory: Killed process 18686 (httpd).
Apr 21 16:48:43 bruna kernel: Out of Memory: Killed process 18687 (httpd).
Apr 21 16:48:43 bruna kernel: Out of Memory: Killed process 18550 (pipe).
Apr 21 16:48:43 bruna kernel: Out of Memory: Killed process 18514 (mrtg).
Apr 21 16:48:43 bruna kernel: Out of Memory: Killed process 18512 (crond).

© 2003-2014 うーたんの小部屋 | Powered by Wordpress