LoginSignup
14
14

More than 5 years have passed since last update.

さくらVPSでKurentoを動かす

Last updated at Posted at 2015-10-04

さくらのVPSに、Kurento Media Server (KMS)を導入し、そのサンプルアプリ(Node.js)を動かすまでのメモです。

1. Ubuntuインストール

KMSはUbuntu 14.04が必須条件なので、VPSコントロールパネルからカスタムOSインストール機能を利用します。

2. Node.jsその他のインストール

今回はnode.js環境でKMSを利用したいので、nodejsおよびnpmをインストールします。悩みたくない人は素直にapt-getでインストールするのがおすすめです。

$ sudo apt-get update
$ sudo apt-get install nodejs npm
$ sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10

また、サンプルアプリを入れるのにgitおよびbowerが必要になるので、これらもインストールしておきます。

$ sudo apt-get install git
$ sudo npm install -g bower

3. Kurento Media Serverのインストール

公式マニュアルの通りに入力するだけです。インストールが終わったら、サービスを立ち上げます。

echo "deb http://ubuntu.kurento.org trusty kms6" | sudo tee /etc/apt/sources.list.d/kurento.list
wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install kurento-media-server-6.0
sudo service kurento-media-server-6.0 start

4. Node.jsサンプルアプリのインストール

git cloneして、npm installするだけです。
初回のみbower installも自動実行されるはずですが、なぜか私の環境ではコケていたので手動で打ち直しました。

git clone https://github.com/Kurento/kurento-tutorial-node.git
cd kurento-tutorial-node/kurento-hello-world
npm install
cd static
bower install

5. Node.jsサンプルアプリの実行

npm startする前に、server.jsの27, 28行目にあるアドレスを書き換えておきます。
たとえばサーバーのアドレスが192.168.100.1だった場合は以下になります。

server.js
as_uri: 'http://192.168.100.1:8080/',
ws_uri: 'ws://192.168.100.1:8888/kurento'

また、ポート8080および8888を忘れずに開放しておきます。通すのはtcpのみで大丈夫なはずです。
用意ができたらnpm startします。

npm start

chromeまたはfirefoxから http://192.168.100.1:8080/ にアクセスします(アドレスは例)。
緑のStartボタンを押して、Webカメラの認証後に両方のstream映像が表示されたら成功です。

kurento-screenshot.jpg

14
14
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
14
14