2008-04-01から1ヶ月間の記事一覧

Apacheモジュール 1.3から2.2への移植: mod_reqinfo

Apacheモジュール プログラミングガイド の中のサンプルプログラムをApache1.3からApache2.2に書き換えたのでそのときのメモ。 #include "httpd.h" #include "http_config.h" #include "http_protocol.h" #include "http_core.h" #include "ap_config.h" /* …

Apache 本体の関数プロトタイプ一覧

# grep AP_DECLARE *.h ap_config.h: * AP_DECLARE_STATIC is defined when including Apache's Core headers, ap_config.h: * @see AP_DECLARE_EXPORT ap_config.h: * AP_DECLARE_STATIC and AP_DECLARE_EXPORT are left undefined when ap_config.h:# defi…

apacheモジュール作成のまとめ

かなり自分用。 hello world の作成 # apxs -g -n hello <- これで雛形ができる。 # cd hello # make # make install/etc/httpd/conf.d/mod_hello.conf を以下のように作成 LoadModule hello_module modules/mod_hello.so <Location /hello> SetHandler hello </Location>apache 再起動&…

APR 関数プロトタイプ一覧

# grep APR_DECLARE *.h apr_allocator.h:APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); apr_allocator.h:APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); apr_allocator.h:APR_DECLARE(apr_memnod…

apache2.2のソースに付属されてくるmod_example.c

自分用に転載 /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licen…

ディスクレス 1CD Linux ロードバランサー

Linux LVS + Keepalived を使ったロードバランサーをKnoppix上に作って、故障しづらいディスクレスのロードバランサーを作ってみた。 Knoppixのカスタマイズは、「KNOPPIXを用いたLaTeX環境の構築とその活用」(http://www.ntt.co.jp/qos/tools/) をほとんど…

CentOS5.1 64ビット版の整数のビット長

テストコード #include <stdio.h> int main(){ printf("int is %d bit.\n", sizeof(int)*8 ); printf("long is %d bit.\n", sizeof(long)*8 ); printf("long long is %d bit.\n", sizeof(long long)*8 ); }結果 int is 32 bit. long is 64 bit. long long is 64 bit.l</stdio.h>…

CentOS5.1 用のApache1.3のRPM作成

checkinstall というプログラムを使えば、ソースファイルから任意のプラットフォーム向けのRPMやdebファイルを作成するできるらしい。実に胡散臭い。でも試してみたのでそのときのメモ。 準備 checkinstall のRPMを rpmfind.net などから探してインストール…

qpsmtpd のインストール メモ

PerlでできたSMTPサーバー qpsmtpd をCentOS5.1にインストールした時のメモ。これを使えば、SpamAssassinや、ClamAVなどをプラグインしたり、自分で書いたプログラムを簡単にプラグインできる。 インストール # yum -y install postfix system-switch-mail #…

ドメイン名、ホスト名、IPアドレスから国名を調べる方法

GeoIPを使えばできる。 インストール方法 CentOS # yum -y install GeoIP-devel GeoIP-data Ubuntu $ sudo apt-get install geoip-binperlからも使いたい場合は以下も。 # perl -MCPAN -e "install Geo::IP" 使い方 # geoiplookup www.yahoo.com GeoIP Count…

いらないデーモンの一括削除

仕事がら、しょっちゅうVMware上にCentOSをセットアップするのだけど、毎回、いらないデーモンを削除するのがめんどくさいのでよく使うコマンドをメモして再利用する。 D=(gpm messagebus irqbalance haldaemon yum mdmpd nscd anacron spamassassin openibd…

Keepalived + LVS + CentOS4 でロードバランサー(DSR)

keepalived は、1.1.15からinclude が使えるようになったので、設定が簡単になったのでお勧め。ありがとうid:stanaka さん。VIP は、 10.0.7.100設定は以下のとおり。(NATの時とほとんど同じだけどVIPを持っているマシンは無い。) WebDB Press vol37 では…

Keepalived + LVS + CentOS4 でロードバランサー(NAT)

keepalived は、1.1.15からinclude が使えるようになったので、設定が簡単になったのでお勧め。ありがとうid:stanaka さん。設定は以下のとおり。 種別 ホスト名 IPアドレス デフォルトゲートウェイ 備考 クライアント cl0 10.0.0.173 通常通り ロードバラン…