さくらのVPS乗り換え
3月に書いたさくらのVPSリニューアルについて、そのうち1GBに増量される予定があるとはいえHDD容量は20GBと100GBの差があり、同じ月額料金でスペックに差が付いてしまう事に悔しい思いをしていたのだが、新プラン乗り換え優遇策が実施されているので、乗り換えることに。
メモリ2GBのCloudCore VPSも試そうかと思ったのだが、月額945円が年契約のキャンペーン価格であり、正規の3ヶ月契約だと2,100円になるので見送った。
何はともあれコンソールから
$ sudo apt-get install openssh-server vimしてopenssh-serverとvimをインストール。 旧サーバから~/.sshを
$ scp -pr ~/.ssh 49.212.xx.yyy:~/と、まるごとコピーした後、/etc/ssh/sshd_configの
- Port番号を22から変更
- PasswordAuthenticationをnoに
- PermitRootLoginをnoに
$ sudo service ssh restartでsshdを再起動した後、remoteからのssh作業にスイッチ。
続いてお約束の設定変更。
$ sudo /usr/sbin/groupmod -n owner yanoで、グループ名とデフォルトエディタを変更。
$ sudo update-alternatives --config editor
$ sudo visudosudoでいちいちパスワードを打たなくていいようvisudoでNOPASSWDオプションを付与しておく。
~~
%admin ALL=(ALL) NOPASSWD: ALL
続いてaptをアップデートし、ntpやbuild-essentialを導入。/etc/ntp.confを編集して、サーバをntp.jst.mfeed.ad.jpに変更。
$ sudo apt-get updateそれからロケール設定。
$ sudo apt-get install ntp build-essential
$ sudo vi /etc/ntp.conf
$ sudo /etc/init.d/ntp restart
$ sudo apt-get install language-pack-jaで日本語(ja_JP.UTF-8)環境をインストールし、~/.bashrcで
$ sudo locale-gen ja_JP.UTF-8
$ sudo /usr/sbin/update-locale LANG=ja_JP.UTF-8
export LC_ALL="ja_JP.UTF-8"てな具合にLC_ALLをexport。
続いてnsdを導入。パッケージとしてはnsd3とnsdがあるが、積極的に旧版をチョイスするだけの根拠は持ち合わせて無いので、素直にnsd3を導入。
$ sudo apt-get install nsd3という具合にインストールできて、昨年のようなエラーは出なくなった。
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
nsd3
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 842kB of archives.
After this operation, 1,622kB of additional disk space will be used.
Get:1 http://jp.archive.ubuntu.com/ubuntu/ lucid/universe nsd3 3.2.4-1 [842kB]
Fetched 842kB in 0s (1,037kB/s)
Selecting previously deselected package nsd3.
(Reading database ... 42388 files and directories currently installed.)
Unpacking nsd3 (from .../archives/nsd3_3.2.4-1_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Setting up nsd3 (3.2.4-1) ...
dpkg-statoverrides: warning: --update given but /etc/nsd3/nsd.conf does not exist
Could not open /etc/nsd3/nsd.conf: No such file or directory
* Building nsd3 zones...
nsd3
$ sudo ls -la /etc/nsd3/
total 16
drwxr-x--- 2 nsd nsd 4096 May 8 11:21 .
drwxr-xr-x 80 root root 4096 May 8 11:46 ..
-rw-r--r-- 1 root root 4406 Dec 14 10:06 nsd.conf.sample
