2006/08/27

リバースプロキシpound

# wget http://www.invoca.ch/pub/packages/pound/pound-2.1-1.src.rpm
# rpm -ivh pound-2.1-1.src.rpm
# vi pound.spec
%define version 2.1
%define rpmrelease 1
# betarelease is either 0 or something like b1
%define betarelease 0
# special features
%define enablemsdav 1 ←(0から1へ変更)

%define distname Pound
 以下省略 ~
# cd /usr/src/redhat/SPECS
# rpmbuild -ba pound.spec
# cd /usr/src/redhat/RPMS/i386/
# ls -la
合計 112
drwxr-xr-x 2 root root 4096 8月 20 23:22 .
drwxr-xr-x 8 root root 4096 8月 18 16:08 ..
-rw-r--r-- 1 root root 70192 8月 20 23:22 pound-2.1-1.i386.rpm
-rw-r--r-- 1 root root 11442 8月 20 23:22 pound-debuginfo-2.1-1.i386.rpm
# rpm -ivh pound-2.1-1.i386.rpm
# cd /etc/pound
# vi /etc/pound/pound.cfg
Group "nobody"
User "nobody"
RootJail "/usr/share/empty"

ListenHTTP

address 192.168.0.12
Port 80

Service
URL "/.*"
BackEnd
address 192.168.0.12
Port 8081
Priority 1
End
Session
Type BASIC
TTL 300
End
End
End

ListenHTTPS
address 192.168.0.12
Port 443
Cert "/etc/pound/cert.pem"
xHTTP 1
WebDAV 1

Service
URL "/WebDav.*"
BackEnd
address 192.168.0.11
Port 80
Priority 1
# WebDAV 1
End
Session
Type BASIC
TTL 300
End
End

Service
URL "/mokuhyo.*"
BackEnd
address 192.168.0.31
Port 80
Priority 1
End
Session
Type BASIC
TTL 300
End
End

Service
URL "/.*"
BackEnd
address 192.168.0.12
Port 8081
Priority 1
End
Session
Type BASIC
TTL 300
End
End

End


# openssl req -x509 -newkey rsa:1024 -keyout cert.pem -out cert.pem -days 3650 -nodes
Generating a 1024 bit RSA private key
....................................................................++++++
........++++++
writing new private key to 'cert.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:JP
State or Province Name (full name) [Berkshire]:Osaka
Locality Name (eg, city) [Newbury]:Osaka
Organization Name (eg, company) [My Company Ltd]:CompanyName
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:homepage.demo
Email Address []:info@
homepage.demo
#



MySQL4 ダンプしてデータ移行

# mysqldump --quick db_name -u root -p |gzip > dumpdata.gz

(この例で作成されるファイルは圧縮されています。)データベースの内容が格納されたファイルを移動先のマシンに転送し、そのマシン上で以下のコマンドを実行します。

# mysqladmin create db_name
# gunzip < dumpdata.gz | mysql db_name

ディスク消去方法

ハードディスクの先頭セクタ1024kbをゼロ書き込みする
MBR消去などが出来る

dd if=/dev/zero of=/dev/sda1 bs=1024k

ハードディスク消去

2回ランダムに書き込みをする

shred -n 2 -v /dev/hda