YANO's digital garage

Copyright ©YANO All rights reserved. https://www.bravotouring.com/~yano/

Last-modified: 2024-05-13 (月)


[一語一絵/IT系]

さくらのVPS 2日目 / 2011-04-22 (金)

昨日の続き。apache2php5のinstall。

yano@vps:~$ apt-get install apache2 php5-mysql php5-cli libapache2-mod-php5
に続いて、サイトの設定。default-siteを元に設定ファイル~yano/etc/apache2/www.bravotouring.comを作成し、default-siteはdisableに。
$ cd /etc/apache2/
$ sudo a2dissite default
Site default disabled.
Run '/etc/init.d/apache2 reload' to activate new configuration!
$ sudo a2enmod ssl
Enabling module ssl.
See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and create self-signed certificates.
Run '/etc/init.d/apache2 restart' to activate new configuration!
$ cd /etc/apache2/sites-available/
$ su -
# ln -s ~yano/etc/apache2/www.bravotouring.com /etc/apache2/sites-available/
# ln -s ~yano/etc/apache2/www.bravotouring.com-ssl /etc/apache2/sites-available/
# a2ensite www.bravotouring.com
Enabling site www.bravotouring.com.
Run '/etc/init.d/apache2 reload' to activate new configuration!
# a2ensite www.bravotouring.com-ssl
Enabling site www.bravotouring.com-ssl.
Run '/etc/init.d/apache2 reload' to activate new configuration!
# make-ssl-cert /usr/share/ssl-cert/ssleay.cnf ~yano/apache-ssl.crt
~~ WindowでCommonName(サイト名)の設定 ~~
# openssl x509 -in ~yano/apache-ssl.crt > /etc/ssl/certs/ssl-cert-www.bravotouring.com.pem
# openssl rsa -in ~yano/apache-ssl.crt > /etc/ssl/private/ssl-cert-www.bravotouring.com.key
# chmod 640 /etc/ssl/private/ssl-cert-www.bravotouring.com.key
# rm ~yano/apache-ssl.crt

続いてphp5関連でPCREの設定UserDirの設定

cgiは各ファイルを/usr/lib/cgi-bin/にまるっとコピー。

【参照】
●VPS(仮想専用サーバ)のさくらインターネット http://vps.sakura.ad.jp/


[一語一絵/IT系]

さくらのVPS 初日 / 2011-04-21 (木)

まずはお約束の設定変更。

$ sudo /usr/sbin/groupmod -n owner yano
$ sudo update-alternatives --config editor
で、グループ名とデフォルトエディタを変更。
$ sudo visudo
sudoでいちいちパスワードを打たなくていいようvisudoでNOPASSWDオプションを付与しておく。
%admin ALL=(ALL) NOPASSWD: ALL
$ sudo vi /etc/ssh/sshd_config
$ sudo /etc/init.d/ssh restart
で、sshのポート番号を変更し、パスワード認証とrootログインを禁止。

続いてaptをアップデートし、ntpbuild-essentialを導入し、ntpサーバを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

それからnsdを導入。パッケージとしてはnsd3nsdがあるが、積極的に旧版をチョイスするだけの根拠は持ち合わせて無いので、素直に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
Could not open /etc/nsd3/nsd.conf: No such file or directory
* Building nsd3 zones...
Could not open /etc/nsd3/nsd.conf: No such file or directory
invoke-rc.d: initscript nsd3, action "start" failed.
dpkg: error processing nsd3 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
nsd3
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo ls -la /etc/nsd3/
total 16
drwxr-x---  2 nsd  nsd  4096 2011-04-21 15:44 .
drwxr-xr-x 77 root root 4096 2011-04-21 15:44 ..
-rw-r--r--  1 root root 4406 2010-02-09 00:35 nsd.conf.sample
と、ひと通りのインストールは出来ているみたいだが~/etc/nsd3/nsd.confが無いという事で起動エラーが出る。ていうか、何も設定してないのに起動しちゃダメでしょう、というわけで/var/lib/dpkg/info/nsd3.postinstのサービス起動処理をコメントアウト
#!/bin/sh -e

set_perms() {
    if ! dpkg-statoverride --list "$4" >/dev/null; then
        dpkg-statoverride --update --add "$@"
    fi
}

if test "$1" = "configure"; then
    if ! getent passwd nsd > /dev/null; then
        adduser --quiet --system --group --no-create-home nsd
    fi

    set_perms nsd nsd 0755 /var/lib/nsd3
    set_perms nsd nsd 0640 /etc/nsd3/nsd.conf
    set_perms nsd nsd 0750 /etc/nsd3
fi

# Automatically added by dh_installinit
if [ -x "/etc/init.d/nsd3" ]; then
       update-rc.d nsd3 defaults >/dev/null
#       if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
#               invoke-rc.d nsd3 start || exit $?
#       else
#                /etc/init.d/nsd3 start || exit $?
#       fi
fi
# End automatically added section


exit 0
して
$ sudo dpkg --configure -a
で再適用しておくとOKだ。

さて肝心の設定は~/etc/nsd3/nsd.conf~/etc/nsd3/xn--48jd5f0d.jp.zoneの設定ファイル編集後、nsd-checkconfで書式を確認し、nsdc rebuildでdbをアップデートした後、nsdc startする流れ。

$ mkdir ~yano/etc
$ sudo mv /etc/nsd3 ~yano/etc
$ sudo ln -s ~yano/etc/nsd3 /etc
$ chmod 755 ~yano/etc/nsd3
$ sudo chown -R yano:owner ~yano/etc/nsd3 /etc
$ cd ~yano/etc/nsd3
$ cp -p nsd.conf.sample nsd.conf
$ vi ~/etc/nsd3/nsd.conf
$ vi ~/etc/nsd3/xn--48jd5f0d.jp.zone
$ nsd-checkconf /etc/nsd3/nsd.conf
$ sudo nsdc rebuild
$ sudo nsdc start
$ nslookup xn--48jd5f0d.jp localhost
Server:         localhost
Address:        127.0.0.1#53

Name:   xn--48jd5f0d.jp
Address: 49.212.xx.yyy
という結果になれば、ひとまず設定はOK。

【参照】
●VPS(仮想専用サーバ)のさくらインターネット http://vps.sakura.ad.jp/


[一語一絵/IT系]

東北新幹線の被害 / 2011-04-20 (水)

震災の影響で福島~盛岡で不通となっている東北新幹線。

主要地震による新幹線の被害
[External]第18回中央新幹線小委員会 配付資料より

先月11日の大地震による被害状況が[External]国土交通省[External]交通政策審議会:中央新幹線小委員会で報告されている。

被災区間は大宮-いわて沼宮内間の536km。上越新幹線「とき325号」の10両中8両が脱線した2004年の新潟中越地震と比較して9~10倍の規模だが、営業運転中だった26本もの列車が一両も脱線せず無事に停止できたのは何よりだったね。

今回の震災では1200箇所を超える数の地上施設が被災したそうだが、高架橋や橋梁、トンネルなどの構造物については大きな損傷が無かった事から、阪神・淡路大震災後に見直された耐震基準に従った補強が為された東海道新幹線はもちろん、リニア中央新幹線についても追加的補強は不要との事。

という事は、九州新幹線も大丈夫という事かな。

『携帯インフラ復旧の現場から』も興味深いので読んでおきたい。

【参照】
●日本経済新聞 http://www.itmedia.co.jp/news/ >> モバイルの達人(石川温)
携帯インフラ復旧の現場から(上)旧型無線技術もフル活用 NTTドコモの1カ月 2011年4月13日
携帯インフラ復旧の現場から(中)極限状態を支えた使命感 KDDIの震災直後 2011年4月14日
携帯インフラ復旧の現場から(下)機材も電波も不足 出遅れたソフトバンクの巻き返し策 2011年4月15日
リニア新幹線「震災による追加投資は不要」、JR東海 2011年4月15日
●国土交通省 http://www.mlit.go.jp/ >> 交通政策審議会:中央新幹線小委員会
第18回中央新幹線小委員会 配付資料 2011年4月15日
●YouTube http://www.youtube.com/
【最終版】上越新幹線とき325号【ありがとう】


[一語一絵]

九州新幹線 / 2011-04-19 (火)

今日は博多11時18分発の熊本行「さくら301号」で、熊本出張。2枚切符で往復7,000円也。

九州新幹線800系
博多駅にて

2月の試乗会では九州・山陽新幹線直通用のN700系7000番台。3号車自由席は2+3列のちょっと安っぽいシートで残念だったのだが、今回は同じ自由席でも800系「さくら」だったので2+2列のシートでゆったり。

さすがに最新の新幹線だけあって揺れは殆ど無く快適そのもの。山陽新幹線のトイレでは手放しで用を足すのはなかなか難しいのだが、九州新幹線では全く余裕だったね。

時間的には閑散期で、しかも端っこの1号車なんで比較的空いている条件ではあるが、わずか5人ほどしか乗ってなかったよ。

復路の「さくら428号」はもう少し多かったが、報道通り震災後の社会情勢もあってなかなか厳しいスタートを実感した。

ただ、GWの予約は堅調に入っているようなので、夏休みに向けて新幹線らしく気持ち良い加速を期待したいね。

【参照】
●JR九州 九州新幹線WEB http://kyushushinkansen.com/
車両紹介 | 800系・新800系
●asahi.com http://www.asahi.com/
九州新幹線、GW中の予約が昨年比2倍 2011年4月15日
●西日本新聞 http://www.nishinippon.co.jp/
GW予約九州堅調 全国は27%減 下落率最大 2011年4月19日


[一語一絵]

XDR集団感染 / 2011-04-18 (月)

東日本大震災と言うより福島第一原発事故の影に隠れてしまいそうな重大ニュース。

結核治療に使われる主要な薬が効かないXDR(超多剤耐性結核菌)の集団感染が国内で初めて佐賀県で発生。

うち8人は同じ民間病院における院内感染という事なので、おちおち入院もしてられないぞ。

震災復興支援も大事だけど、鳥インフルエンザ、口蹄疫しかり、初動が大事なので足元もしっかりお願いしますよ。

【参照】
●西日本新聞 http://www.nishinippon.co.jp/
10人から超多剤耐性結核菌 佐賀の病院 全国初、集団感染 2011年4月16日
●九州発 : YOMIURI ONLINE http://kyushu.yomiuri.co.jp/
超多剤耐性結核に10人感染、5人が発症 2011年4月16日
●佐賀新聞 http://www.saga-s.co.jp/
薬が効きにくい結核で集団感染 県中部 2011年4月15日