Skip to content

Running notepages on ubuntu

gpolitis edited this page Aug 29, 2011 · 1 revision

Notepages on Ubuntu

About

Based on the etherpad-lite wiki.

How to install notepages on Ubuntu

  1. Install node.js from Chris Lea's repository, he seems to update his repository regularly.
  2. Install npm with curl http://npmjs.org/install.sh | sh
  3. Install mongodb from the mongodb official repository.
  4. Install the redis server from Rowan's repository, he seems to update his repository regularly.
  5. Move to a folder where you want to install notepages. Clone the git repository with git clone 'git://github.com/fivesixty/notepages.git'.
  6. Install dependencies with npm install.
  7. Clone bundled libraries : ace, mdext, quickdiff and store.
  8. Start notepages with node server.js.
  9. Open your web browser and visit http://localhost:8888!

How to deploy notepages as an Upstart service

  1. tailor NPHOME, NPUSER and NPLOGS
  2. save to /etc/init/notepages.conf
  3. sudo start notepages
description "notepages" 

start on network
stop on runlevel [!2345]

env NPHOME=/srv/www/np.example.com/public_html 
env NPLOGS=/srv/www/np.example.com/logs/notepages
env NPUSER=www-data

pre-start script 
    chdir $NPHOME 
    mkdir $NPLOGS                              ||true 
    chown $NPUSER:admin $NPLOGS                ||true 
    chmod 0755 $NPLOGS                         ||true 
    chown -R $NPUSER:admin $NPHOME/var         ||true 
    npm install >> $NPLOGS/app.log 2>> $NPLOGS/error.log || { stop; exit 1; } 
end script 

script 
  cd $NPHOME 
  exec su -s /bin/sh -c 'exec "$0" "$@"' $NPUSER node server.js \ 
                        >> $NPLOGS/app.log \ 
                        2>> $NPLOGS/error.log 
end script 

How to put notepages behind nginx

server {
    listen       443;
    server_name  np.example.com;

    access_log  /srv/www/np.example.com/logs/nginx/access.log;
    error_log   /srv/www/np.example.com/logs/nginx/error.log;

    ssl                  on;
    ssl_certificate      /srv/www/np.example.com/ssl/np.crt;
    ssl_certificate_key  /srv/www/np.example.com/ssl/np.key;

    ssl_session_timeout  5m;

    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers   on;

    location / {
        proxy_pass             http://localhost:8888/;
        proxy_set_header       Host $host;
        proxy_buffering off;
    }
}

server {
    listen      80;
    server_name np.example.com;
    rewrite     ^(.*)   https://$server_name$1 permanent;
}