heroku

herokuを使う。

$ sudo yum -y install rubygems
$ gem install -r -p http://server:port/ heroku
$ gem install heroku
$ mkdir cramps && cd cramps
$ git init
$ touch README
$ git add .
$ git commit -m "cramps"
$ heroku create
git push heroku master

project url

http://cramps.heroku.com/

Ruby on Rails 3 アプリケーションプログラミング

Ruby on Rails 3 アプリケーションプログラミング

PaaS

Google App Engine以外にも触手を伸ばす。

アカウント取得

http://www.fluxflex.com/
http://no.de/
http://www.heroku.com/

プロジェクト作成

http://meteors.fluxflex.com/
http://batmobile.no.de/

cname

$ dig meteors.psychobil.ly

;; QUESTION SECTION:
;meteors.psychobil.ly. IN A

;; ANSWER SECTION:
meteors.psychobil.ly. 3539 IN CNAME 30dd3f0df6cfe4d7dab5eacfac3eacb2c137e11c.dns.fluxflex.com.
30dd3f0df6cfe4d7dab5eacfac3eacb2c137e11c.dns.fluxflex.com. 86339 IN CNAME meteors.fluxflex.com.
meteors.fluxflex.com. 86339 IN CNAME app1.fluxflex.com.
app1.fluxflex.com. 86339 IN CNAME applb-1833250967.us-east-1.elb.amazonaws.com.
applb-1833250967.us-east-1.elb.amazonaws.com. 60 IN A 50.19.84.175

クラウド大全 第2版

クラウド大全 第2版

分散失敗

glusterfsでの分散ファイルシステム構築失敗。
peer probeでノード追加してvolume作成して、mountまでは出きるが参照が出来ない(参照しようとすると応答が無くなる)。
当面はs3で凌ぐことにする。

s3fsはレスポンス遅すぎるのでキャッシュ効かせないと辛い。

memo

firefox add-ons

s3fox

Installing RPMforge

CentOSでRPMforgeパッケージを使えるようにする。

参考

http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

install

$ sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
$ sudo rpm -K http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm: (sha1) dsa sha1 md5 gpg OK
$ sudo rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm を取得中
準備中... ########################################### [100%]
1:rpmforge-release ########################################### [100%]
$ sudo yum -y install htop

cms

wordpress保留。
eZ Publish無料版を試してみる。

install

$ curl http://share.ez.no/content/download/118008/553423/version/3/file/ezpublish_community_project-2011.8-with_ezc.tar.bz2 -o ezpublish_community_project-2011.8-with_ezc.tar.bz2
$ tar xvjf ezpublish_community_project-2011.8-with_ezc.tar.bz2
$ sudo mv ezpublish_community_project-2011.8-with_ezc /usr/local/nginx
$ cd /usr/local/nginx
$ sudo ln -s ezpublish_community_project-2011.8-with_ezc ezpublish
$ cat /usr/local/nginx/conf/nginx.conf

server {
listen 80;
server_name frenzy.psychobil.ly;

location / {
root /usr/local/nginx/ezpublish;
index index.html index.htm index.php;
deny 216.13.56.89;
}

location ~ \.php$ {
root /usr/local/nginx/ezpublish;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

server_tokens off;
}

php依存パッケージ
$ sudo yum -y install php-xml

fascgi再起動
$ sudo /etc/init.d/php-fastcgi stop
$ sudo /etc/init.d/php-fastcgi start

db準備

$ mysql -uroot -p
mysql> CREATE DATABASE ez CHARACTER SET utf8;
mysql> GRANT ALL ON ez.* TO ez@localhost IDENTIFIED BY 'xxx';
mysql> GRANT ALL ON ez.* TO ez@"ip-10-xxx-xxx-aaa.ap-northeast-1.compute.internal" IDENTIFIED BY 'xxx';
mysql> GRANT ALL ON ez.* TO ez@"ip-10-xxx-xxx-bbb.ap-northeast-1.compute.internal" IDENTIFIED BY 'xxx';
mysql> FLUSH PRIVILEGES;

nginx サブドメイン設定

blog用にサブドメインを設定。

.
.
# blog - wordpress
server {
  listen 80;
  server_name frenzy.psychobil.ly;
  location / {
  root html/wordpress;
  index index.html index.htm index.php;
  deny 216.13.56.89;
  }

  location ~ \.php$ {
   root html/wordpress;
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  include fastcgi_params;
  }

  server_tokens off;
}
.
.

ハイパフォーマンスHTTPサーバ Nginx入門

ハイパフォーマンスHTTPサーバ Nginx入門