GNU/Linux >> Tutoriales Linux >  >> Debian

Cómo instalar Etherpad Lite en Debian Wheezy

En este tutorial, le mostraremos cómo instalar Etherpad Lite en Debian Wheezy. Etherpad Lite es un editor web de código abierto que proporciona edición colaborativa en tiempo real, incluido un cuadro de chat integrado. Todo esto tiene lugar en uno de nuestros planes de alojamiento VPS de Linux, pero debería funcionar igual de bien en cualquier otra instalación de Linux.

El siguiente comando instalará todos los paquetes necesarios

apt-get install gzip git-core curl python libssl-dev pkg-config \
                build-essential python g++ make checkinstall \
                nginx-full mysql-server

A continuación, debemos compilar e instalar nodejs

cd /usr/src/
wget http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure && checkinstall

Cuando se abra la ventana de diálogo, ingrese '3' y elimine la "v" delante del número de versión.
Instale nodejs con el siguiente comando

dpkg -i node_*

Cree una base de datos MySQL o MariaDB

CREATE DATABASE etherpad CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON etherpad.* TO etherpad@localhost IDENTIFIED BY '__yourPasswd__';
FLUSH PRIVILEGES;
\q

Instalar y configurar Etherpad Lite

Vaya al directorio donde desea instalar Etherpad Lite y clone el repositorio git

cd /var/www/
git clone git://github.com/ether/etherpad-lite.git

Edite el archivo de configuración

cd etherpad-lite/
cp settings.json.template settings.json
vim settings.json

y cambie las siguientes configuraciones:

// change the IP Address
"ip": "127.0.0.1",
// set a session key
"sessionKey" : "rAnD0m5tRIng",
//configure the connection settings
 "dbType" : "mysql",
 "dbSettings" : {
   "user"    : "etherpad",
   "host"    : "localhost",
   "password": "__yourPassword__",
   "database": "etherpad"
 },
// add admin user
"users": {
 "admin": {
 "password": "__yourAdminPassword__",
 "is_admin": true
 }
},

Crear un usuario del sistema

adduser --system --home=/var/www/etherpad-lite/ --group etherpad
chown -R etherpad: /var/www/etherpad-lite/

Inicie Etherpad Lite por primera vez:

su -c "/var/www/etherpad-lite/bin/run.sh" -s /bin/bash etherpad

Si todo está bien, elimine todos los procesos que pertenezcan al usuario de etherpad

pkill -u etherpad

Cree una secuencia de comandos de inicio con su editor favorito

#!/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/www/etherpad-lite/etherpad-lite.log"
EPLITE_DIR="/var/www/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
chmod +x /etc/init.d/etherpad-lite
update-rc.d etherpad-lite defaults
/etc/init.d/etherpad-lite start

Crear un nuevo host virtual (bloque de servidor)

vim /etc/nginx/sites-available/domain.tld.conf

server {
 listen       80;
 server_name  domain.tld;
   location / {
     proxy_pass        http://localhost:9001/;
     proxy_set_header  Host $host;
     proxy_buffering   off;
   }
 }

ln -s /etc/nginx/sites-available/domain.tld /etc/nginx/sites-enabled/domain.tld
/etc/init.d/nginx restart

En caso de que esté usando Apache, puede usar la siguiente directiva de host virtual

vim /etc/apache2/sites-available/domain.tld

<VirtualHost *:80>
    ServerName domain.tld
    ServerSignature Off
    <IfModule mod_proxy.c>
        ProxyVia On
        ProxyRequests Off
        ProxyPass / http://127.0.0.1:9001/
        ProxyPassReverse / http://127.0.0.1:9001/
        ProxyPreserveHost on
        <Proxy *>
            Options FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Proxy>
    </IfModule>
</VirtualHost>

ln -s /etc/apache2/sites-available/domain.tld /etc/apache2/sites-enabled/domain.tld
a2enmod proxy proxy_http
/etc/init.d/apache2 restart

¡Eso es todo! Ahora puede acceder a Etherpad Lite desde su navegador.

Página de inicio del proyecto Etherpad en GitHub

Si está buscando otras opciones, puede leer nuestra guía sobre cómo instalar Etherpad en Debian 9.


Debian
  1. Cómo instalar Debian 10 (Buster)

  2. Cómo instalar Python 3.9 en Debian 10

  3. Cómo instalar Chive en un VPS Debian Wheezy

  4. Cómo instalar DokuWiki en Debian Wheezy con Nginx

  5. Cómo instalar Etherpad en Debian 9

Cómo instalar Etherpad Lite en Ubuntu 20.04 LTS

Cómo instalar Go en Debian 10

Cómo instalar Etherpad en Debian 11

Cómo instalar Wine en Debian 7 Wheezy

Cómo instalar el escritorio Xfce en Debian 7 sibilante

Cómo instalar Go en Debian