etherpad-lite Test-Installation

Blick auf die RuhrSolche Regenwochenenden bieten sich an, um auch mal etwas ‚abwegiges‘ auszuprobieren ;) – und so versuchte ich mich mal an einer ‚etherpad‘-Installation.
So ganz mal eben ist das nicht installiert und eine wirklich zusammenhängende Anleitung fand ich auch nicht. Aber wirkliches Hexenwerk ist es auch nicht und so habe ich es dann tatsächlich zum Laufen bekommen und hatte dann etwas, bei dem für mich die Frage aufkam, wozu genau _ich_ das brauche!? Womit ich jetzt nicht abstreiten will, dass es dafür Einsatzmöglichkeiten gibt, nur eben für mich (im Moment) nicht! :twisted:
Ein paar Tips für die Installation fand ich hier:

  • https://github.com/ether/etherpad-lite/blob/master/README.md
  • http://d24m.de/2011/08/24/howto-installation-von-etherpad-lite-v1/
  • https://linksunten.indymedia.org/de/node/54110
  • https://github.com/Pita/ueberDB/wiki/MySQL-Sockets
  • https://github.com/ether/etherpad-lite/wiki
  • http://etherpad.org/#download

Installation

Also dann wieder zurück zu meiner Installation:

apt-get install build-essential python libssl-dev git-core libsqlite3-dev gzip curl
mkdir node.js && cd $_
# http://nodejs.org/dist/
#./node-latest.tar.gz                                 18-Jan-2013 20:37            12164371
#./v0.9.8/node-v0.9.8.tar.gz                                 24-Jan-2013 17:57            12617530
wget -N "http://nodejs.org/dist/node-latest.tar.gz"
tar xf node-latest.tar.gz
cd node-v0.8.18/
./configure
make
make install
#
curl https://npmjs.org/install.sh | sh
#
mkdir /home/httpd/etherpad && cd $_
git clone https://github.com/ether/etherpad-lite
vi /home/httpd/etherpad/etherpad-lite/settings.json
addgroup --gid 142 etherpad-lite
adduser --home "/home/httpd/etherpad" --shell "/bin/false" --uid 142 --ingroup users --gecos "Etherpad-Lite" --disabled-login etherpad-lite
adduser etherpad-lite etherpad-lite
chown -R etherpad-lite:etherpad-lite /home/httpd/etherpad
mkdir /var/log/etherpad
chown etherpad-lite /var/log/etherpad
sudo -u etherpad-lite /home/httpd/etherpad/etherpad-lite/bin/run.sh
lsof -i :9531
#
diff -Natu /home/httpd/etherpad/etherpad-lite/settings.json.org /home/httpd/etherpad/etherpad-lite/settings.json

Die Änderungen an der ./etherpad-lite/settings.json

--- /home/httpd/etherpad/etherpad-lite/settings.json.org        2013-02-03 09:57:45.000000000 +0100
+++ /home/httpd/etherpad/etherpad-lite/settings.json    2013-02-03 19:49:44.000000000 +0100
@@ -5,15 +5,15 @@
 */
 {
   // Name your instance!
-  "title": "Etherpad Lite",
+  "title": "Saturn-Etherpad Lite",
 
   // favicon default name
   // alternatively, set up a fully specified Url to your own favicon
-  "favicon": "favicon.ico",
+  "favicon": "/favicon.ico",
 
   //IP and port which etherpad should bind at
-  "ip": "0.0.0.0",
-  "port" : 9001,
+  "ip": "localhost",
+  "port" : 9531,
 
   /*  
   // Node native SSL support
@@ -31,28 +31,41 @@
 
   //The Type of the database. You can choose between dirty, postgres, sqlite and mysql
   //You shouldn't use "dirty" for for anything else than testing or development
-  "dbType" : "dirty",
+/*  "dbType" : "dirty",
   //the database specific settings
   "dbSettings" : {
                    "filename" : "var/dirty.db"
                  },
-                 
-  /* An Example of MySQL Configuration
+  */               
+  /* An Example of MySQL Configuration */
    "dbType" : "mysql",
    "dbSettings" : {
-                    "user"    : "root", 
-                    "host"    : "localhost", 
-                    "password": "", 
-                    "database": "store"
+                    "user"    : "etherpad", 
+    "port" : "/var/run/mysqld/mysqld.sock",
+                    "password": "CHangeme", 
+                    "database": "etherpad"
                   },
-  */
+/*                    "host"    : "localhost", */
 
   //Logging configuration. See log4js documentation for further information
   // https://github.com/nomiddlename/log4js-node
+/*
   "logconfig" :
         { "appenders": [
             { "type": "console" }
         ] },
+*/
+  "logconfig" :
+        { "appenders": [
+    {
+      "type": "file",
+      "absolute": true,
+      "filename": "/var/log/etherpad/etherpad.log",
+      "maxLogSize": 20480,
+      "backups": 10,
+      "category": "absolute-logger"          
+    }
+        ] },
 
   //the default text of a pad
   "defaultPadText" : "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http:\/\/etherpad.org\n",
@@ -77,25 +90,25 @@
 
   /* This setting is used if you require authentication of all users.
      Note: /admin always requires authentication. */
-  "requireAuthentication": false,
+  "requireAuthentication": true,
 
   /* Require authorization by a module, or a user with is_admin set, see below. */
-  "requireAuthorization": false,
+  "requireAuthorization": true,
 
   /* Users for basic authentication. is_admin = true gives access to /admin.
      If you do not uncomment this, /admin will not be available! */
-  /*
+
   "users": {
     "admin": {
-      "password": "changeme1",
+      "password": "CHangeme2",
       "is_admin": true
     },
-    "user": {
-      "password": "changeme1",
+    "uwe": {
+      "password": "CHangeme1",
       "is_admin": false
     }
   },
-  */
+ 
 
   /* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */
   "loglevel": "INFO",

Start-Script

vi /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/etherpad-lite.log"
EPLITE_DIR="/usr/share/etherpad-lite"
EPLITE_DIR="/home/httpd/etherpad/etherpad-lite" #/bin/run.sh
EPLITE_BIN="bin/safeRun.sh"
USER="etherpad-lite"
GROUP="etherpad-lite"
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

Apache-Konfiguration

chmod +x /etc/init.d/etherpad-lite
#update-rc.d etherpad-lite defaults
/etc/init.d/etherpad-lite start
#
vi /etc/apache2/sites-available/etherpad-lite.inc.conf
Redirect  /pad2         /pad2/
ProxyRequests Off
ProxyVia On
ProxyPreserveHost on
   <Proxy *:443 >
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order Deny,allow
        Allow from all
   </Proxy>
 
ProxyPass        /pad2/ http://localhost:9531/
ProxyPassReverse /pad2/ http://localhost:9531/
echo "  Include /etc/apache2/sites-available/etherpad-lite.inc.conf" >> /etc/apache2/sites-enabled/02host.conf
vi /etc/apache2/sites-enabled/02host.conf
#

MySQL-Einrichtung

Weil ich die Datenbank-Einstellungen auf ‚mysql‘ geändert habe, muss ich in diesen MySQL-User auch einrichten:

GRANT ALL  PRIVILEGES ON etherpad . * TO etherpad@localhost IDENTIFIED BY 'password';
CREATE DATABASE etherpad;
ALTER DATABASE `etherpad` CHARACTER SET utf8 COLLATE utf8_bin;
FLUSH PRIVILEGES;

Test:

mysql -u etherpad -h localhost -p

Fertig

auf der Halde HanielNach dem Ausführen des Start-Scriptes lief dann der Dienst (fast) unmittelbar.
Unter der URL https://host/pad2/admin bekam man dann auch eine Art Admin-Interface.
Aber weil ich selbst (wie gesagt) keine Verwendung für etherpad-lite habe, ist bei mir jetzt der Dienst auch wieder gestoppt. :twisted:

Gelesen: 1339 · heute: 2 · zuletzt: Sat 12.October 2019

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.