$ rvm install ruby-1.9.3-p125
Installing Ruby from source to: /home/deployer/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...

ruby-1.9.3-p125 - #fetching 
ruby-1.9.3-p125 - #extracted to /home/deployer/.rvm/src/ruby-1.9.3-p125 (already extracted)
Applying patch 'xcode-debugopt-fix-r34840' (located at /home/deployer/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff)
Error running 'patch -F 25 -p1 -N -f <"/home/deployer/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff"', please read /home/deployer/.rvm/log/ruby-1.9.3-p125/patch.apply.xcode-debugopt-fix-r34840.log

autoconfが必要らしいので入れる。

$ sudo apt-get install autoconf

こういう場合、普通にinstallするとパッチ当て損ないのソースをもう一度使おうとするらしく、reinstallする。

$ rvm reinstall ruby-1.9.3-p125

OK。

$ apt-cache search git-core
git-core - fast, scalable, distributed revision control system (obsolete)
git - fast, scalable, distributed revision control system

へー。Debian Squeezeではgit-coreはgitかー。

さくらVPS 512のDebian Squeezeに入れた。(さくらVPS 512にSqueezeを入れる方法はこちら

apacheと古いphp5を削除

$ sudo apt-get remove --purge apache2* apache2.2* php5*
$ sudo apt-get autoremove

dotdeb

$ sudo vi /etc/apt/source.list
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all
$ wget http://www.dotdeb.org/dotdeb.gpg
$ cat dotdeb.gpg | sudo apt-key add -
$ rm dotdeb.gpg

nginx

$ sudo apt-get install nginx
server {
        listen 80;
        server_name unk.fjord.jp;

        location / {
                root /var/www/unk.fjord.jp;
                index index.html index.php;
        }

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /var/www/unk.fjord.jp$fastcgi_script_name;
        }
}

php5-fpm

$ sudo apt-get install php5-fpm

apc

$ sudo apt-get install php5-apc

mysql

$ sudo apt-get install mysql-client mysql-server php5-mysql

wordpress

(略)

速いし良い感じッス。

さくらインターネットのVPSにDebian Squeezeをインストールする。

デフォルトのCentOSでネットワークの設定を記録しておく。

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# cat /etc/resolv.conf

installerをダウンロードする。

# mkdir /boot/new
# cd /boot/new
# wget ftp://ftp.jp.debian.org/pub/Linux/Debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
# wget ftp://ftp.jp.debian.org/pub/Linux/Debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux

grubからinstallerを起動できるようにする。

# /boot/grub/grub.conf:
(...)
title new squeeze amd64
        root (hd0,0)
        kernel /new/linux ro root=LABEL=/ console=tty0 console=ttyS0,115200n8r
        initrd /new/initrd.gz

rebootしたらgrubのmenuでinstallerが選べるのでインストールする。

参照:タイトルは明日考えます: さくらのVPSでシリアルコンソールからDebianインストール

capistranoで小ハマリ。

Emacsとかcapistranoとかコマンド経由でCentOSにsudoすると「ttyが無い」的なメッセージが出て出来ない。

CentOS

$ sudo diff sudoers.org sudoers
56c56
< Defaults requiretty
---
> #Defaults requiretty

visudoでDefaults requirettyという行をコメントアウトすれば行けるみたい。

Debian Squeeze

Defaults visiblepw

Capistrano側で対応する場合

recipeに下記を追加

default_run_options[:pty] = true

参照:sudo: sorry, you must have a tty to run sudo