I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
user www www; | |
worker_processes 5; | |
error_log logs/error.log; | |
pid logs/nginx.pid; | |
worker_rlimit_nofile 8192; | |
events { | |
worker_connections 4096; | |
} |
### | |
Module dependencies | |
### | |
require.paths.unshift "#{__dirname}/lib/support/express-csrf/" | |
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/" | |
express = require 'express' | |
app = module.exports = express.createServer() | |
RedisStore = require 'connect-redis' |
/** | |
* database.js | |
* The core database setup file for the project | |
*/ | |
/** | |
* The couchdb module instance | |
*/ | |
var cradle = require('cradle'); |
/*global require */ | |
// Illustration-only for a mailing list discussion - not a recommended pattern | |
// for production because of root usage. Untested. | |
// http://groups.google.com/group/nodejs/browse_thread/thread/b41ad5d727d8dff8 | |
// usage example: | |
// node thisfile.js local server:create | |
// node thisfile.js local server:stop <IP> | |
// node thisfile.js local server:start <IP> |
// before | |
mainWindow.menu("File", function(err, file) { | |
if(err) throw err; | |
file.openMenu(function(err, menu) { | |
if(err) throw err; | |
menu.item("Open", function(err, item) { | |
if(err) throw err; | |
item.click(function(err) { | |
if(err) throw err; | |
mainWindow.getChild(type('Window'), function(err, dialog) { |
var express = require('./') | |
, http = require('http') | |
, https = require('https') | |
, app = express.createServer(); | |
app.use(express.static(__dirname)); | |
http.createServer(app.handle.bind(app)).listen(3000); | |
https.create.... |
In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.
It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.
you might want to take a look at a demo app