# rpmbuild -ba SPEC/httpd.spec
…(中略)…
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... i586-pc-linux-gnu
checking host system type... i586-pc-linux-gnu
checking target system type... i586-pc-linux-gnu
Configuring Apache Portable Runtime library ...
checking for APR... yes
setting CC to "Usage: apr-config [OPTION]
Known values for OPTION are:
--prefix[=DIR] change prefix to DIR
--bindir print location where binaries are installed
--includedir print location where headers are installed
--cflags print C compiler flags
--cppflags print cpp flags
--includes print include information
--ldflags print linker flags
--libs print additional libraries to link against
--srcdir print APR source directory
--installbuilddir print APR build helper directory
--link-ld print link switch(es) for linking to APR
--link-libtool print the libtool inputs for linking to APR
--shlib-path-var print the name of the shared library path env var
--apr-la-file print the path to the .la file, if available
--apr-so-ext print the extensions of shared objects on this platform
--apr-lib-target print the libtool target information
--apr-libtool print the path to APR's libtool
--version print the APR's version as a dotted triple
--help print this help
When linking with libtool, an application should do something like:
APR_LIBS="`apr-config --link-libtool --libs`"
or when linking directly:
APR_LIBS="`apr-config --link-ld --libs`"
An application should use the results of --cflags, --cppflags, --includes,
and --ldflags in their build process."
setting CPP to "Usage: apr-config [OPTION]
Known values for OPTION are:
--prefix[=DIR] change prefix to DIR
--bindir print location where binaries are installed
--includedir print location where headers are installed
--cflags print C compiler flags
--cppflags print cpp flags
--includes print include information
--ldflags print linker flags
--libs print additional libraries to link against
--srcdir print APR source directory
--installbuilddir print APR build helper directory
--link-ld print link switch(es) for linking to APR
--link-libtool print the libtool inputs for linking to APR
--shlib-path-var print the name of the shared library path env var
--apr-la-file print the path to the .la file, if available
--apr-so-ext print the extensions of shared objects on this platform
--apr-lib-target print the libtool target information
--apr-libtool print the path to APR's libtool
--version print the APR's version as a dotted triple
--help print this help
When linking with libtool, an application should do something like:
APR_LIBS="`apr-config --link-libtool --libs`"
or when linking directly:
APR_LIBS="`apr-config --link-ld --libs`"
An application should use the results of --cflags, --cppflags, --includes,
and --ldflags in their build process."
adding "-pthread" to CFLAGS
setting CPPFLAGS to " -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
-D_SVID_SOURCE -D_GNU_SOURCE"
setting LDFLAGS to " "
setting INCLUDES to " -I/usr/include/apr-0 "
Configuring Apache Portable Runtime Utility library...
checking for APR-util... yes
checking for gcc... Usage: apr-config [OPTION]
Known values for OPTION are:
--prefix[=DIR] change prefix to DIR
--bindir print location where binaries are installed
--includedir print location where headers are installed
--cflags print C compiler flags
--cppflags print cpp flags
--includes print include information
--ldflags print linker flags
--libs print additional libraries to link against
--srcdir print APR source directory
--installbuilddir print APR build helper directory
--link-ld print link switch(es) for linking to APR
--link-libtool print the libtool inputs for linking to APR
--shlib-path-var print the name of the shared library path env var
--apr-la-file print the path to the .la file, if available
--apr-so-ext print the extensions of shared objects on this platform
--apr-lib-target print the libtool target information
--apr-libtool print the path to APR's libtool
--version print the APR's version as a dotted triple
--help print this help
When linking with libtool, an application should do something like:
APR_LIBS="`apr-config --link-libtool --libs`"
or when linking directly:
APR_LIBS="`apr-config --link-ld --libs`"
An application should use the results of --cflags, --cppflags, --includes,
and --ldflags in their build process.
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.
エラー: Bad exit status from /var/tmp/rpm-tmp.30417 (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.30417 (%build)
APR_SETIFNULL(CC, `$apr_config --cc`) APR_SETIFNULL(CPP, `$apr_config --cpp`)
# rpmbuild -ba SPEC/apr.spec …(中略)… 書き込み中: /home/files/RPMS/SRPMS/apr-0.9.4-0.1.src.rpm 書き込み中: /home/files/RPMS/RPMS/i386/apr-0.9.4-0.1.i386.rpm 書き込み中: /home/files/RPMS/RPMS/i386/apr-devel-0.9.4-0.1.i386.rpm 書き込み中: /home/files/RPMS/RPMS/i386/apr-debuginfo-0.9.4-0.1.i386.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.46950 + umask 022 + cd /home/files/RPMS/BUILD + cd apr + rm -rf /var/tmp/apr-0.9.4-0.1-buildroot + exit 0 # sudo rpm -Fvh RPMS/i386/apr*-0.9.4-0.1.i386.rpm Preparing... ########################################### [100%] 1:apr ########################################### [ 50%] 2:apr-devel ########################################### [100%]
# rpmbuild -ba SPEC/httpd.spec
…(中略)…
Making all in support
make[1]: Entering directory `/home/files/RPMS/BUILD/httpd-2.0.46/prefork/support
'
make[2]: Entering directory `/home/files/RPMS/BUILD/httpd-2.0.46/prefork/support
'
/bin/sh /usr/bin/libtool --silent --mode=compile gcc -pthread -O2 -march=k6 -m
cpu=k6 -DUCD_COMPATIBLE -I/usr/kerberos/include -I/usr/kerberos/include -DLINUX
=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -
DAP_HAVE_DESIGNATED_INITIALIZER -I/usr/include/apr-0 -I. -I/home/files/RPMS/BU
ILD/httpd-2.0.46/support -I/home/files/RPMS/BUILD/httpd-2.0.46/prefork/server/mp
m/prefork -I/home/files/RPMS/BUILD/httpd-2.0.46/prefork/include -I/home/files/RP
MS/BUILD/httpd-2.0.46/os/unix -I/home/files/RPMS/BUILD/httpd-2.0.46/server/mpm/p
refork -I/home/files/RPMS/BUILD/httpd-2.0.46/modules/http -I/home/files/RPMS/BUI
LD/httpd-2.0.46/modules/filters -I/home/files/RPMS/BUILD/httpd-2.0.46/modules/pr
oxy -I/home/files/RPMS/BUILD/httpd-2.0.46/include -I/usr/local/include -I/usr/in
clude/openssl -I/home/files/RPMS/BUILD/httpd-2.0.46/modules/dav/main -prefer-non
-pic -static -c /home/files/RPMS/BUILD/httpd-2.0.46/support/htpasswd.c && touch
htpasswd.lo
/bin/sh /usr/bin/libtool --silent --mode=link gcc -pthread -O2 -march=k6 -mcpu
=k6 -DUCD_COMPATIBLE -I/usr/kerberos/include -I/usr/kerberos/include -DLINUX=2
-D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP
_HAVE_DESIGNATED_INITIALIZER -I/usr/include/apr-0 -I. -I/home/files/RPMS/BUILD
/httpd-2.0.46/support -I/home/files/RPMS/BUILD/httpd-2.0.46/prefork/server/mpm/p
refork -I/home/files/RPMS/BUILD/httpd-2.0.46/prefork/include -I/home/files/RPMS/
BUILD/httpd-2.0.46/os/unix -I/home/files/RPMS/BUILD/httpd-2.0.46/server/mpm/pref
ork -I/home/files/RPMS/BUILD/httpd-2.0.46/modules/http -I/home/files/RPMS/BUILD/
httpd-2.0.46/modules/filters -I/home/files/RPMS/BUILD/httpd-2.0.46/modules/proxy
-I/home/files/RPMS/BUILD/httpd-2.0.46/include -I/usr/local/include -I/usr/inclu
de/openssl -I/home/files/RPMS/BUILD/httpd-2.0.46/modules/dav/main -export-dynami
c -L/usr/local/lib -o htpasswd htpasswd.lo -lz /home/files/RPMS/BUILD/httpd
-2.0.46/prefork/srclib/pcre/libpcre.la -L/usr/kerberos/lib -lssl -lcrypto -lreso
lv -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -ldl -lz /usr/lib/libaprutil-0.la -
lldap -llber -lgdbm -ldb -lexpat /usr/lib/libapr-0.la -lrt -lm -lcrypt -lnsl -ld
l
libtool: link: cannot find the library `/usr/local/lib/libgdbm.la'
make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/home/files/RPMS/BUILD/httpd-2.0.46/prefork/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/files/RPMS/BUILD/httpd-2.0.46/prefork/support'
make: *** [all-recursive] Error 1
エラー: Bad exit status from /var/tmp/rpm-tmp.53207 (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.53207 (%build)
## /usr/lib/libaprutil-0.la (抜粋)##
# Libraries that this one depends upon.
dependency_libs=' -lldap -llber /usr/local/lib/libgdbm.la -ldb /usr/lib/libexpat
.la /usr/lib/libapr-0.la -lrt -lm -lcrypt -lnsl -ldl'
# rpmbuild --rebuild apr-util-0.9.3-6.src.rpm
# sudo rpm -Fvh RPMS/i386/apr-util*-0.9.3-6.i386.rpm
## /usr/lib/libaprutil-0.la (抜粋)##
# Libraries that this one depends upon.
dependency_libs=' -lldap -llber /usr/lib/libgdbm.la -ldb /usr/lib/libexpat
.la /usr/lib/libapr-0.la -lrt -lm -lcrypt -lnsl -ldl'
# rpmbuild -ba SPEC/httpd.spec
…(中略)…
書き込み中: /home/files/RPMS/SRPMS/httpd-2.0.46-3.src.rpm
書き込み中: /home/files/RPMS/RPMS/i386/httpd-2.0.46-3.i386.rpm
書き込み中: /home/files/RPMS/RPMS/i386/httpd-devel-2.0.46-3.i386.rpm
書き込み中: /home/files/RPMS/RPMS/i386/httpd-manual-2.0.46-3.i386.rpm
書き込み中: /home/files/RPMS/RPMS/i386/mod_ssl-2.0.46-3.i386.rpm
書き込み中: /home/files/RPMS/RPMS/i386/httpd-debuginfo-2.0.46-3.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.39303
+ umask 022
+ cd /home/files/RPMS/BUILD
+ cd httpd-2.0.46
+ rm -rf /var/tmp/httpd-root
+ exit 0
# sudo /sbin/service httpd stop httpdを停止中: [ OK ] # sudo rpm -Fvh RPMS/i386/httpd*-2.0.46-3.i386.rpm RPMS/i386/mod_ssl-2.0.46-3.i386.rpm Preparing... ########################################### [100%] 1:httpd 警告: /etc/httpd/conf/httpd.conf created as /etc/htt pd/conf/httpd.conf.rpmnew ########################################### [ 25%] 2:httpd-devel ########################################### [ 50%] 3:httpd-manual ########################################### [ 75%] 4:mod_ssl ########################################### [100%] # sudo /sbin/service httpd start httpdを起動中: [ OK ]
# sudo /sbin/service httpd start
httpdを起動中: Syntax error on line 6 of /etc/httpd/conf.d/php.conf:
Cannot load /etc/httpd/modules/libphp4.so into server: libpspell.so.4: cannot op
en shared object file: No such file or directory
[失敗]
# su $ cd /usr/lib/ $ ln -s libpspell.so.15.0.2 libpspell.so.4 $ ls libpspell* -l lrwxrwxrwx 1 root root 19 6月 5 08:11 libpspell.so -> libpspe ll.so.15.0.2 lrwxrwxrwx 1 root root 19 6月 5 08:11 libpspell.so.15 -> libp spell.so.15.0.2 -rwxr-xr-x 1 root root 3296 5月 30 23:25 libpspell.so.15.0.2 lrwxrwxrwx 1 root root 19 6月 7 02:42 libpspell.so.4 -> libps pell.so.15.0.2 $ exit exit # sudo /sbin/service httpd start httpdを起動中: Syntax error on line 6 of /etc/httpd/conf.d/php.conf: Cannot load /etc/httpd/modules/libphp4.so into server: /etc/httpd/modules/libphp 4.so: undefined symbol: new_pspell_config [失敗]
# rpm -qpl RPMS/i386/pspell012-0.12.2-15.i386.rpm /usr/lib/libpspell-impl.so.6 /usr/lib/libpspell-impl.so.6.0.0 /usr/lib/libpspell-modules.so.1 /usr/lib/libpspell-modules.so.1.0.1 /usr/lib/libpspell.so.4 /usr/lib/libpspell.so.4.0.3 /usr/share/doc/pspell012-0.12.2 /usr/share/doc/pspell012-0.12.2/README # sudo rpm -ivh RPMS/i386/pspell012-0.12.2-15.i386.rpm Preparing... ########################################### [100%] 1:pspell012 ########################################### [100%] # sudo /sbin/service httpd start httpdを起動中: [ OK ]
○ PostgreSQL 7.3.2 → 7.3.3
これはオフィシャルパッケージで。
○ SQL Slammer ワームのログ取り
1 月25日午後に影響が拡がった今回のワーム。うちのサーバへの流れ込み具合を簡単にまとめたのでこちらのレポートもどうぞ。
さて、うちのサーバはルータも兼ねているので足跡がばっちりログに残っている。とりあえずいろいろと解析するためにログからワームのログだけ抜き出すスクリプトを。SQL Slammer は 1434/udp へ送られてくるので、フィルタリングログから「PROTO=UDP」と「DPT=1434」を含む行を抽出する。これだけでほとんど事足りるわけだけど、ホスト名の参照や時間帯別集計なんかがしやすい perl でコーディング。うちではこれで事足りるわけだけど、いろいろと手抜きをしてるんでそこらへんはご了承下さいまし(汗
## anasslog.pl ## #!/bin/perl # ログファイルから必要な部分を抽出するコマンド $cmd=<<'CMD_END'; grep -h 'ip_drop.* PROTO=UDP .* DPT=1434' /var/log/messages* \ | awk '{ split($9,dpt,"="); print $1,$2","$3","dpt[2] }' \ | sort CMD_END # 入出力をオープン open(IN, "$cmd|") || die "input open error"; open(OUT, ">sqlslam.log") || die "output open error"; # データ終端まで一行ずつ読み込む while($data = <IN>) { chomp $data; ($date, $time, $ip) = split(",", $data); ($hour, $min, $sec) = split(":", $time); $COUNT{"$date $hour"}++; # 時間別カウントをインクリメント # IPアドレス→ホスト名変換 $host = gethostbyaddr(pack('C4', split(/\./, $ip)), 2); print OUT "$date,$time,$ip,$host\n"; } # 入出力をクローズ close(OUT); close(IN); # 時間別カウントをファイルに吐き出す open(OUT, ">count.log") || die "count log open error"; foreach $key ( sort keys %COUNT ) { print OUT "$key -> $COUNT{$key}\n"; } close(OUT);