GNU/Linux >> Linux Esercitazione >  >> Cent OS

Installa Etherpad su un VPS CentOS 7

In questo tutorial spiegheremo come installare Etherpad su un CentOS 7 VPS. Etherpad è un editor online Open Source che fornisce editing collaborativo in tempo reale. Questa guida dovrebbe funzionare anche su altri sistemi VPS Linux, ma è stata testata e scritta per CentOS 7 VPS.

Accedi al tuo VPS tramite SSH

ssh user@vps

Aggiorna il sistema e installa i pacchetti necessari

[user]$ sudo yum -y upgrade
[user]$ sudo yum install curl vim gcc-c++ make

Installa MariaDB

MariaDB 5.5 viene fornito nel repository CentOS 7 predefinito, per installarlo basta eseguire:

[user]$ sudo yum install mariadb-server

Per avviare il servizio MariaDB e consentirne l'avvio all'avvio, eseguire i seguenti comandi:

[user]$ sudo systemctl start mariadb.service
[user]$ sudo systemctl enable mariadb.service

Esegui il comando seguente per proteggere la tua installazione:

[user]$ sudo mysql_secure_installation

Successivamente, dobbiamo creare un database per la nostra istanza Etherpad.

[user]$ mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE etherpad;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON etherpad.* TO 'etherpaduser'@'localhost' IDENTIFIED BY 'etherpaduser_passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Installa l'ultimo Node.js

[user]$ curl -sL https://rpm.nodesource.com/setup | sudo bash -
[user]$ sudo yum install -y nodejs

Per verificare che tutto sia stato eseguito correttamente, usa il comando node --version .
L'output dovrebbe essere simile al seguente:

[user]$ node --version
v0.10.38

Crea utente Etherpad

Per creare un nuovo utente di sistema per la nostra istanza Etherpad, esegui i seguenti comandi:

[user]$ sudo adduser --home /opt/etherpad --shell /bin/bash etherpad
[user]$ sudo install -d -m 755 -o etherpad -g etherpad /opt/etherpad

Installa Etherpad

I seguenti comandi vengono eseguiti come utente etherpad. Per passare all'esecuzione dell'utente etherpad:

[user]$ sudo su - etherpad

Clona il codice sorgente di Etherpad su /opt/etherpad/etherpad-lite directory.

[etherpad]$ git clone git://github.com/ether/etherpad-lite.git ~/etherpad-lite

Copia il file di configurazione delle impostazioni predefinite:

[user]$ cp ~/etherpad-lite/settings.json.template ~/etherpad-lite/settings.json

e cambia/aggiungi:

  • "ip": "0.0.0.0" a "ip": "127.0.0.1"
  • Commenta la sezione "sporca"
  • Aggiungi la configurazione MySQL
        "dbType" : "mysql",
        "dbSettings" : {
                        "user"    : "etherpaduser",
                        "host"    : "localhost",
                        "password": "etherpaduser_passwd",
                        "database": "etherpad"
                      },
    
    
  • "trustProxy" : false a "trustProxy" : true
  • Aggiungi utente amministratore
          "users": {
             "admin": {
             "password": "__yourAdminPassword__",
             "is_admin": true
             }
            },
    

Esegui il comando seguente per installare le dipendenze:

~/etherpad-lite/bin/installDeps.sh

Avvia Etherpad per la prima volta:

~/etherpad-lite/bin/run.sh

Se non ci sono errori, puoi continuare con il passaggio successivo.

Crea un servizio systemd

Per creare un nuovo servizio systemd per Etherpad, apri il tuo editor preferito come utente root o sudo e crea un nuovo file:

[user]$ sudo vim /etc/systemd/system/etherpad.service

e aggiungi le seguenti righe di codice:

[Unit]
Description=Etherpad
After=syslog.target network.target

[Service]
Type=simple
User=etherpad
Group=etherpad
ExecStart=/opt/etherpad/etherpad-lite/bin/run.sh
Restart=always

[Install]
WantedBy=multi-user.target

Avvia il servizio Etherpad e impostalo per l'avvio automatico all'avvio:

[user]$ sudo systemctl enable etherpad.service
[user]$ sudo systemctl start etherpad.service

Per verificare l'avvio dell'unità, eseguire journalctl -f -u etherpad.service e dovresti vedere qualcosa come di seguito:

[user]$ journalctl -f -u etherpad.service
May 09 11:02:08 vps systemd[1]: Starting etherpad.service...
May 09 11:02:08 vps systemd[1]: Started etherpad.service.
May 09 11:02:08 vps run.sh[23118]: Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.

Installa e configura Nginx

Installare Nginx è abbastanza semplice, basta eseguire il seguente comando:

[user]$ sudo apt-get install nginx

Quindi, crea un nuovo blocco del server Nginx:

[user]$ sudo vim /etc/nginx/sites-available/myPad.com.conf
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
  server_name myPad.com;

  location / {
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header  Host $host;
    proxy_redirect off;
    proxy_read_timeout 300;
    proxy_pass http://localhost:9001/;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
  }
}

Attiva il blocco del server riavviando Nginx:

[user]$ sudo systemctl restart nginx

In futuro, ogni volta che vorrai aggiornare l'Etherpad all'ultima versione, esegui semplicemente /opt/etherpad/etherpad-lite && git pull origin e riavvia il servizio Etherpad con systemctl restart etherpad .

Questo è tutto. Hai installato correttamente Etherpad sul tuo Centos VPS. Per ulteriori informazioni su Etherpad, fare riferimento al sito Web di Etherpad.

Ovviamente non devi fare nulla di tutto ciò se utilizzi uno dei nostri servizi di hosting VPS Linux, nel qual caso puoi semplicemente chiedere ai nostri esperti amministratori Linux di configurarlo per te. Sono disponibili 24 ore su 24, 7 giorni su 7 e si prenderanno immediatamente cura della tua richiesta.

PS . Se questo post ti è piaciuto condividilo con i tuoi amici sui social network utilizzando i pulsanti a sinistra o semplicemente lascia una risposta qui sotto. Grazie.


Cent OS
  1. Come installare phpBB 3 su un CentOS 6 VPS

  2. Installa Dotclear su un VPS CentOS

  3. Installa GlassFish su un CentOS 6 VPS

  4. Installa Octopress su un VPS CentOS 6

  5. Installa phpMyBackupPro su un VPS CentOS 6

Installazione di Redmine su un VPS CentOS 6

Installa Odoo 8 su un VPS CentOS 7

Installa CouchDB su un VPS Linux CentOS

Installa PHP-Fusion 7 su un VPS CentOS 7

Come installare phpList su un VPS CentOS 7

Installa Habari su un VPS CentOS 7