#voorlichter のサーバサイドについて
先述のように、#voorlichter のサーバサイドでは、Amazon EC2 上で tilestream を動かすようにしている。具体的には、http://bulky.handygeospatial.info で tilestream が動いており、#voorlichter (http://www.handygeospatial.info/voorlichter/) で使われているタイルは、tilestream の標準サービスでは http://bulky.handygeospatial.info/#!/map/voorlichter で動いている。tilestream の標準サービスでは http://bulky.handygeospatial.info/#!/map/voorlichter_old で動いている。なお、http://bulky.handygeospatial.info/#!/map/voorlichter は、等高線にマウスカーソルを持っていくと地図フレームの右上に標高が表示されるバージョンである。本エントリでは、サーバサイドについて最小限のメモを残す。
Amazon EC2 インスタンスの選定
Amazon Web Services の無料使用範囲に収まる「Amazon Linux AMI」(https://aws.amazon.com/amazon-linux-ami/2012.03-release-notes/)を1インスタンス用意した。1年間の無料使用期間が終わればそれなりの費用がかかるが、それまでに十分に実験ができるだろう。導入方法は、Amazon Web Services のインストラクションどおり。
tilestream のインストール
tilestream のインストールは、https://github.com/mapbox/tilestream の Installation: Ubuntu 10.04 とほぼおなじ。
mbtiles 置き場も、スタンダードに従い、~/Documents/MapBox/tiles にすることにした。
tilestream のサービス化
最近は、/etc/init/tilestream.conf というファイルを用意するらしい。
description "tilestream" author "hfu" start on filesystem and net-device-up stop on shutdown respawn exec /home/ec2-user/local/node/bin/node /home/ec2-user/local/node/bin/tilestream --config=/home/ec2-user/tilestream.conf.json --accesslog >> /home/ec2-user/tilestream.log
それで、
$ sudo initctl start tilestream
でサービス開始。
ちなみに、/home/ec2-user/tilestream.log のサイズはゼロのまま。何か修正が必要かもしれない。
また、/home/ec2-user/tilestream.conf.json の内容は次の通り。
{"host": ["bulky.handygeospatial.info"], "uiPort": "80", "tilePort": "80", "tiles": "/home/ec2-user/Documents/MapBox/tiles"}
なお、もちろん、ネームサービスの設定は必要である(Amazon Web Services の外)。