Etherpad Liteを体験するにはこのリンクから
https://github.com/ether/etherpad-lite/wiki/Sites-that-run-Etherpad-Lite
Etherpad と Etherpad Liteの比較はここ
https://github.com/ether/etherpad-lite
node.js の インストール
Etherpad Liteはnode.jsを使っているので、事前に準備しておく。
CentOS6にはまだパッケージが無いので、公式からバイナリを持ってきて配置する。
http://nodejs.org/download/
# wget http://nodejs.org/dist/v0.8.16/node-v0.8.16-linux-x64.tar.gz
# tar zxvf node-v0.8.16-linux-x64.tar.gz
解凍したフォルダを任意の場所に配置し、パスの通ったディレクトリへリンクを貼っておく。
# mv node-v0.8.16-linux-x64.tar.gz /opt
# cd /opt/node-v0.8.16-linux-x64/bin
# ln -s node /usr/bin
# ln -s node-waf /usr/bin
# ln -s npm /usr/bin
MySQLの設定
Etherpad LiteのバックエンドにはいくつかのDBが使えるが、MySQLが推奨されている。
パッケージのインストール
# yum install mysql-server
# chkconfig mysql-server on
# /etc/init.d/mysqld start
パスワードの設定
# mysqladmin -u root password 'password'
匿名ユーザを削除
# mysql -uroot -p
mysql> select user, password, host from mysql.user;
+------+-------------------------------------------+---------------------------------+ | user | password | host | +------+-------------------------------------------+---------------------------------+ | root | *3A4A03AC22526F6B591010973A741D59A71D728E | localhost | | root | | kvps-27-34-160-192.secure.ne.jp | | root | | 127.0.0.1 | | | | localhost | | | | kvps-27-34-160-192.secure.ne.jp | +------+-------------------------------------------+---------------------------------+
mysql> use mysql;
mysql> delete from user where user = '' or ( user = 'root' and host != 'localhost' );
mysql> flush privileges;
mysql> select user, password, host from mysql.user;
+------+-------------------------------------------+-----------+ | user | password | host | +------+-------------------------------------------+-----------+ | root | *3A4A03AC22526F6B591010973A741D59A71D728E | localhost | +------+-------------------------------------------+-----------+
データベースの作成
mysql> create database `etherpad-lite` CHARACTER SET utf8;
mysql> exit
Etherpadの設定
ユーザの作成
# useradd -d /opt/etherpad etherpad
# su - etherpad
ソースの取得
$ mkdir tmp ; cd tmp
$ git clone https://github.com/ether/etherpad-lite.git
ブランチの固定
$ cd etherpad-lite
$ git checkout -b 1.2.1 remotes/origin/release/releases-1.2.1
依存パッケージの導入
$ sh bin/installDeps.sh
設定ファイルの編集
$ cp settings.json.template settings.json
{
"title": "Etherpad Lite",
"favicon": "favicon.ico",
"ip": "0.0.0.0",
"port" : 9001,
"dbType" : "mysql",
"dbSettings" : {
"user" : "root",
"host" : "localhost",
"password": "password",
"database": "etherpad-lite"
},
"defaultPadText" : "",
"requireSession" : false,
"editOnly" : false,
"minify" : true,
"maxAge" : 21600, // 60 * 60 * 6 = 6 hours
"abiword" : null,
"requireAuthentication": false,
"requireAuthorization": false,
"users": { "admin": { "password": "pass1", "is_admin": true },
"user1": { "password": "pass2", "is_admin": true },
"user2": { "password": "pass3", "is_admin": false}
},
"loglevel": "WARN"
}
自動起動設定
# vim /etc/init.d/etherpad-lite
#!/bin/sh
#
# etherpad-lite - this script starts and stops the etherpad light daemon
#
# chkconfig: - 64 36
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 2 3 4 6
# Required-Start:
# description: etherpad lite is a collaboration editor
# processname: node
# config: /srv/etherpad-lite/settings.json
# pidfile: none
# lockfile: /var/lock/subsys/etherpad-light
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
progname="Etherpad Lite"
path="/opt/etherpad/etherpad-lite"
prog="/usr/bin/node"
parameter="node_modules/ep_etherpad-lite/node/server.js"
log="$path/log/error.log"
conf="$path/settings.json"
user="etherpad"
lockfile="/var/lock/subsys/etherpad-light"
logpath=$(dirname $log)
start() {
[ -x $prog ] || exit 5
[ -f $conf ] || exit 6
[ -d $logpath ] || mkdir $logpath
[ -f $log ] || touch $log
chown $user $logpath
chown $user $log
echo -n $"Starting $progname: "
daemon --user=$user "cd $path; $prog $parameter >>$log &"
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $progname: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
status)
rh_status
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 2
esac
# chkconfig --add /etc/init.d/etherpad-lite
# chkconfig etherpad-lite on
# /etc/init.d/etherpad-lite start
0 件のコメント:
コメントを投稿