Dies ist eine alte Version des Dokuments!
Etherpad aufsetzen
Diese Anleitung ist eine erste Hilfestellung und vermutlich noch nicht
vollständig.
Voraussetzungen
apt-get install nodejs nodejs-legacy npm curl
Installationsort: /var/www/etherpad
Systembenutzer einrichten
adduser --system --group --no-create-home --home /var/www/etherpad etherpad
Programm herunterladen und installieren
cd /var/www
wget https://github.com/ether/etherpad-lite/archive/1.6.1.zip
unzip 1.6.1.zip
rm 1.6.1.zip
ln -s etherpad-lite-1.6.1 etherpad
chown -R etherpad etherpad-lite-1.6.1
Datenbank vorbereiten
die Datenbank soll „etherpad“ heißen
der Datenbankbenutzer soll ebenfalls „etherpad“ heißen
gutes kennwort für den Benutzer ausdenken. Das dieses lediglich in der Konfiguration eingetragen wird, spricht nichts gegen ein langes, komplexes Kennwort
mysql -u root -p
> CREATE DATABASE etherpad;
> CREATE USER 'etherpad'@'localhost' IDENTIFIED BY '********';
> GRANT CREATE,ALTER,SELECT,INSERT,UPDATE,DELETE ON etherpad.* TO 'etherpad'@'localhost';
> exit
Kennwort ändern im Fehlerfall
SET PASSWORD FOR 'etherpad'@'localhost' = PASSWORD('new-password-here');
FLUSH PRIVILEGES;
Konfiguration
cd etherpad
cp settings.json.template settings.json
- settings.json
"dbType" : "mysql",
"dbSettings" : {
"user" : "etherpad",
"host" : "localhost",
"password": "********",
"database": "etherpad",
"charset" : "utf8mb4"
},
"loglevel": "WARN",
"users": {
"admin": {
"password": "****",
"is_admin": true
},
"user": {
"password": "****",
"is_admin": false
}
},
Optional: Proxy konfigurieren, falls Etherpad hinter einem Proxy eingerichtet wird
npm config set proxy http://"user:pass"@proxy.example.com:3128
npm config set https-proxy http://"user:pass"@proxy.example.com:3128
Starten
cd /var/www/etherpad
su etherpad -c bin/run.sh
Init-Script
SysV-Initscript
- /etc/init.d/etherpad-lite
#!/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="/var/log/etherpad-lite.log"
EPLITE_DIR="/var/www/etherpad-lite"
EPLITE_BIN="bin/safeRun.sh"
USER="etherpad"
GROUP="etherpad"
DESC="Etherpad Lite"
NAME="etherpad-lite"
# Exit if the package is not installed
[ -x $EPLITE_DIR/$EPLITE_BIN ] || exit 0
# Define LSB log_* functions
. /lib/lsb/init-functions
# Create logfile with proper user if not exists
if [ ! -e $LOGFILE ]; then
touch $LOGFILE
chmod 660 $LOGFILE
chgrp $GROUP $LOGFILE
fi
do_start() {
start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true
}
#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}
}
do_stop() {
if [ ! -f /var/run/$NAME.pid ]; then
log_progress_msg "Process not found..."
return 2
fi
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
}
do_restart() {
log_progress_msg "stopping..."
do_stop
if [ $? -eq "2" ]; then
return 2
fi
sleep 1
log_progress_msg "starting..."
do_start
}
status() {
status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $?
}
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_restart
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
status)
status_of_proc -p /var/run/$NAME.pid "$EPLITE_DIR/$EPLITE_BIN" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $NAME {start|stop|restart|status}" >&2
exit 1
;;
esac