Difference between revisions of "Mesh/SudoPad"

From Sudo Room
Jump to navigation Jump to search
Line 3: Line 3:
Etherpad lite is a real time collaborative editor which allows multiple users to simultaneously work with the same document.
Etherpad lite is a real time collaborative editor which allows multiple users to simultaneously work with the same document.


SudoPad is available at https://peoplesopen.net/pad or https://peoplesopen.net:9001. The following guide was used for initial setup, https://help.ubuntu.com/community/Etherpad-liteInstallation. Other documentation regarding etherpad can be found in its repo, https://github.com/ether/etherpad-lite.
SudoPad is available at https://peoplesopen.net/pad or https://peoplesopen.net:9001. Documentation regarding etherpad can be found in its repo, https://github.com/ether/etherpad-lite.


=== Troubleshooting ===
== Troubleshooting ==
If you receive an nginx error (like 503 bad gateway) when going to https://peoplesopen.net/pad:
If you receive an nginx error (like 503 bad gateway) when going to https://peoplesopen.net/pad:
* Try going to https://peoplesopen.net:9001
* Try going to https://peoplesopen.net:9001
Line 11: Line 11:
   sudo start etherpad-lite
   sudo start etherpad-lite


=== TODO ===
== Setup Instructions ==
* transfer setup instructions for posterity
The following are the instructions that were used to install our instance of etherpad-lite and could be used to reinstall the instance from scratch. Instructions adapted from https://help.ubuntu.com/community/Etherpad-liteInstallation.
 
1. Add a new etherpad-specific system user, etherpad should never be run as root in production.
  sudo adduser --system --home=/opt/etherpad --group etherpad
2. Install prequistes, some of these may already be installed, but it is always good to check that they are up-to-date,
  sudo apt-get update
  sudo apt-get install gzip git-core curl python libssl-dev build-essential abiword python-software-properties
3. Next, you'll need to install Node.JS and NPM, (someone please confirm steps for install node js, i think it was already installed)
  sudo add-apt-repository ppa:chris-lea/node.js
  sudo apt-get update
  sudo apt-get install nodejs
4. Install and test etherpad-lite with following command,
  sudo su - etherpad -s /bin/bash
  mkdir -p ~/local/etherpad
  cd ~/local/etherpad
  git clone git://github.com/ether/etherpad-lite.git
  cd etherpad-lite
  bin/run.sh
5. Etherpad should now be running manually, you can check by going to <hostname>:9001
6. However, you will want to set up etherpad as a service that can be run in the background, to do this,
  sudo mkdir /var/log/etherpad-lite
  sudo chown etherpad /var/log/etherpad-lite
  sudo chown -R etherpad /var/log/etherpad-lite
  sudo nano /etc/init/etherpad-lite.conf
 
7. In the etherpad-lite.conf file paste the following:
 
  description "etherpad-lite"
  start on started networking
  stop on runlevel [!2345]
  env EPHOME=/opt/etherpad/local/etherpad/etherpad-lite 
  env EPLOGS=/var/log/etherpad-lite
  env EPUSER=etherpad
  pre-start script
      cd $EPHOME
      mkdir $EPLOGS                              ||true
      chown $EPUSER:admin $EPLOGS                ||true
      chmod 0755 $EPLOGS                        ||true
      chown -R $EPUSER:admin $EPHOME/var        ||true
      $EPHOME/bin/installDeps.sh >> $EPLOGS/error.log || { stop; exit 1; }
  end script
  script
      cd $EPHOME/
      exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- node node_modules/ep_etherpad-lite/node/server.js \
                        >> $EPLOGS/access.log \
                        2>> $EPLOGS/error.log
  end script
 
8. Assuming everything worked correctly, you should be able to start the etherpad service,
  sudo start etherpad-lite
 
9. Check if it worked by going again to <hostname>:9001
 
== Setup MySQL Database ==
You may have noticed a warning about DirtyDB in the logs when you started the service. It is advised that you do not use DirtyDB in production, instead, we setup a MySQL database for etherpad in our existing MySQL instance.
 
== TODOs ==
* transfer setup instructions for posterity (in progress)
* setup/check-on the timetable for clearing abandoned pads
* setup/check-on the timetable for clearing abandoned pads
* troubleshooting steps?

Revision as of 17:01, 5 February 2018

This is a place for providing instructions, documenting changes, and troubleshooting problems regarding SudoPad, the etherpad-lite instance running on the sudomesh server.

Etherpad lite is a real time collaborative editor which allows multiple users to simultaneously work with the same document.

SudoPad is available at https://peoplesopen.net/pad or https://peoplesopen.net:9001. Documentation regarding etherpad can be found in its repo, https://github.com/ether/etherpad-lite.

Troubleshooting

If you receive an nginx error (like 503 bad gateway) when going to https://peoplesopen.net/pad:

  • Try going to https://peoplesopen.net:9001
  • If this also fails, start (or restart) the etherpad instance by logging into sudomesh server and running,
  sudo start etherpad-lite

Setup Instructions

The following are the instructions that were used to install our instance of etherpad-lite and could be used to reinstall the instance from scratch. Instructions adapted from https://help.ubuntu.com/community/Etherpad-liteInstallation.

1. Add a new etherpad-specific system user, etherpad should never be run as root in production.

  sudo adduser --system --home=/opt/etherpad --group etherpad

2. Install prequistes, some of these may already be installed, but it is always good to check that they are up-to-date,

  sudo apt-get update
  sudo apt-get install gzip git-core curl python libssl-dev build-essential abiword python-software-properties

3. Next, you'll need to install Node.JS and NPM, (someone please confirm steps for install node js, i think it was already installed)

  sudo add-apt-repository ppa:chris-lea/node.js
  sudo apt-get update
  sudo apt-get install nodejs

4. Install and test etherpad-lite with following command,

  sudo su - etherpad -s /bin/bash 
  mkdir -p ~/local/etherpad
  cd ~/local/etherpad
  git clone git://github.com/ether/etherpad-lite.git
  cd etherpad-lite
  bin/run.sh 

5. Etherpad should now be running manually, you can check by going to <hostname>:9001 6. However, you will want to set up etherpad as a service that can be run in the background, to do this,

  sudo mkdir /var/log/etherpad-lite
  sudo chown etherpad /var/log/etherpad-lite
  sudo chown -R etherpad /var/log/etherpad-lite
  sudo nano /etc/init/etherpad-lite.conf

7. In the etherpad-lite.conf file paste the following:

  description "etherpad-lite"
  start on started networking
  stop on runlevel [!2345]
  env EPHOME=/opt/etherpad/local/etherpad/etherpad-lite  
  env EPLOGS=/var/log/etherpad-lite
  env EPUSER=etherpad
  pre-start script
     cd $EPHOME
     mkdir $EPLOGS                              ||true
     chown $EPUSER:admin $EPLOGS                ||true
     chmod 0755 $EPLOGS                         ||true
     chown -R $EPUSER:admin $EPHOME/var         ||true
     $EPHOME/bin/installDeps.sh >> $EPLOGS/error.log || { stop; exit 1; }
  end script
  script
     cd $EPHOME/
     exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- node node_modules/ep_etherpad-lite/node/server.js \
                       >> $EPLOGS/access.log \
                       2>> $EPLOGS/error.log
  end script

8. Assuming everything worked correctly, you should be able to start the etherpad service,

  sudo start etherpad-lite

9. Check if it worked by going again to <hostname>:9001

Setup MySQL Database

You may have noticed a warning about DirtyDB in the logs when you started the service. It is advised that you do not use DirtyDB in production, instead, we setup a MySQL database for etherpad in our existing MySQL instance.

TODOs

  • transfer setup instructions for posterity (in progress)
  • setup/check-on the timetable for clearing abandoned pads