Etherpad-lite
De MochilaWiki
Ir para navegaçãoIr para pesquisarPágina do projeto
A instalação foi realizado num sistema Debian GNU/Linux 7
Instalando Nodejs
apt-get install curl
curl --silent --location https://deb.nodesource.com/setup_0.12 | bash -
apt-get install --yes nodejs
Instalando
apt-get install git-core nginx
useradd -m etherpad
cd /home/etherpad/
git clone git://github.com/ether/etherpad-lite.git
./etherpad-lite/bin/installDeps.sh
cd /home/etherpad/etherpad-lite/
cp settings.json.template settings.json
chown -R etherpad: /home/etherpad/
Criando Banco de Dados
create database etherpad;
grant all privileges on etherpad.* to 'etherpad'@'192.168.0.1' identified by 'suasenha';
flush privileges;
Ajuste no arquivo de configuração
No arquivo settings.json altera:
- Na linha 126 altere a senha, no lugar de changeme1
- Remova o conteúdo da linha 123 e 134
- Na linha 53, remova o conteúdo */ e coloque no final da linha 44
- Insira // nas linhas 38, 40, 41 e 42
- Coloque as informações do banco de dados nas linhas 47 a 50
Configuração no Nginx
Num arquivo vazio em /etc/nginx/sites-enabled/default coloque
server {
listen 80;
server_name pad.lavits.org;
access_log /var/log/nginx/pad.lavits.org.log;
error_log /var/log/nginx/pad.lavits.org.error.log;
location / {
proxy_pass http://localhost:9001/;
proxy_set_header Host $host;
proxy_buffering off;
}
}
Inicialização
Copie o conteúdo abaixo em /etc/init.d/etherpad
#!/bin/sh
### BEGIN INIT INFO
# Provides: etherpad-lite
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts etherpad lite
# Description: starts etherpad lite using start-stop-daemon
### END INIT INFO
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin"
LOGFILE="/home/etherpad/etherpad-lite/etherpad-lite.log"
EPLITE_DIR="/home/etherpad/etherpad-lite"
EPLITE_BIN="bin/safeRun.sh"
USER="etherpad"
GROUP="etherpad"
DESC="Etherpad Lite"
NAME="etherpad-lite"
set -e
. /lib/lsb/init-functions
start() {
echo "Starting $DESC... "
start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true
echo "done"
}
#We need this function to ensure the whole process tree will be killed
killtree() {
local _pid=$1
local _sig=${2-TERM}
for _child in $(ps -o pid --no-headers --ppid ${_pid}); do
killtree ${_child} ${_sig}
done
kill -${_sig} ${_pid}
}
stop() {
echo "Stopping $DESC... "
while test -d /proc/$(cat /var/run/$NAME.pid); do
killtree $(cat /var/run/$NAME.pid) 15
sleep 0.5
done
rm /var/run/$NAME.pid
echo "done"
}
status() {
status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $?
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: $NAME {start|stop|restart|status}" >&2
exit 1
;;
esac
exit 0
depois rode os comandos
chmod +x /etc/init.d/etherpad
update-rc.d etherpad defaults
service etherpad start
Atualizando
su - etherpad
cd ~/etherpad-lite/
git pull origin
Referências
- https://www.tekovic.com/etherpad-lite-up-n-running-in-5-minutes
- http://zeldor.biz/2014/01/etherpad-installation/
- https://www.digitalocean.com/community/tutorials/how-to-install-etherpad-for-production-with-node-js-and-mysql-on-a-vps
- https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions