5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

サーバーサイドSwiftのPerfectを動かす

Last updated at Posted at 2016-06-09

Perfectはこちら

まずはubuntu上でswiftを動かせるようにします
※前回投稿した記事で動かせるように出来ます 参考記事

前回同様下記でcontainer化してログインします

$ docker run -it --privileged ubuntu:swift-test /bin/bash

前回の記事でswiftのPATHを定義していない場合は定義してしまいましょう
(.bashrcでexportしないと毎回読み込まれないっぽいです。なんでかは気が向いたら調べます。。。)
そして読み込ませます

$ apt-get install vim
$ cd root/
$ vi .bashrc

export PATH=/swift-2.2.1-RELEASE-ubuntu15.10/usr/bin/:"${PATH}"

$ source .bashrc
$ cd /

ではPerfectをDLしてくるところまでやります
Perfectの最新リリースは現在v1.0.0みたいなので落として解凍します

$ wget https://github.com/PerfectlySoft/Perfect/archive/v1.0.0.tar.gz
$ tar xzf v1.0.0.tar.gz

$ cd Perfect-1.0.0/

makefileがあるのでmakeを使うみたいです
makeとその他必要なライブラリをインストールします

$ apt-get update
$ apt-get install libevent-dev libsqlite3-dev libicu-dev libcurl4-openssl-dev uuid-dev libssl-dev make

PerfectはPerfectLibとPerfectServerによって構成されており、PerfectServerはPerfectLibが必要なのでビルドします

$ cd PerfectLib
$ make clean
$ make
$ make install

次にPerfectServerをビルドします

$ cd ../PerfectServer
$ make clean
$ make
$ make install

(実は「Perfect-1.0.0/」上でmakeをすれば勝手にやってくれるっぽい)

ここまでこればあとは下記を実行すればPerfectが動きます

$ perfectserverhttp

お疲れ様でした!
※commitを忘れずに☆


~追記~

動作確認までしてみましょう!

docker-machineのIPアドレスを調べておきます
出てきたIPアドレスをメモしておきましょう。

$ docker-machine ip

ポートを指定してPerfectをインストールしたimageをcontainer化します

$ docker run -it -p 8181:8181 ubuntu:swift-test /bin/bash

perfectを動かします

$ perfectserverhttp

さあ、ブラウザで確認しましょう
http://(先ほど調べたIPアドレス):8181/

The file "/" was not found.

こんな感じで出てきましたか?
以上です!

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?