Deploying Node.js application services

Deploy Ghost blogging system using Passenger on Dreamhost or other hosting providers

(Mon Mar 05 2018 16:00:00 GMT-0800 (Pacific Standard Time))

Ghost is a very popular blogging platform which, because it's written in Node.js, is not what you'd expect to install on a traditional web hosting provider who supports PHP. Dreamhost is one of the many dozens or hundreds of web hosting providers whose bread-and-butter is PHP application hosting. Dreamhost, for example, has a specially configured Wordpress hosting service, Dreampress, that looks very useful. However, Dreamhost also allows hosting of Node.js applications. Let's see how to get Ghost running on a Dreamhost Virtual Private Server.

Deploy Node.js application using Passenger on Dreamhost or other hosting providers

(Sun Jan 07 2018 16:00:00 GMT-0800 (Pacific Standard Time))

On regular web hosting PHP rules the world, and you might think Node.js has no chance. I haven't cross-checked among current web hosting providers, but Dreamhost does offer the option of hosting Ruby or Node.js applications on a VPS using Passenger. In case you've never heard of Passenger, it is an "app server" for hosting Ruby, Python or Node.js applications. Dreamhost supports all three, but for our purpose we're interested in using this to run a Node.js app.

Deprecating buggy npm packages, dealing with deprecations

(2016-08-25 10:20) It seems several critical npm packages deprecated older releases. Installing the old version of some packages causes npm to print a warning saying the package was deprecated, and to use a newer version of the package. Sometimes the message suggests a way to figure out where the package is being required. Due to the way an npm package can pull in other npm packages, it can be tricky to figure out where the deprecated package version is being used.

Is Node.js / Express scalable? How to grow Node.js app deployment to handle more traffic?

(2016-05-01 09:29) Since Node.js is billed as being very fast, high performance, application development platform, you might think it automatically "scales" to fill out server resources and satisfy a huge workload. While you can do this with a Node.js application, you have to design the scaling mechanism yourself. With no additional configuration, a Node.js application can saturate a single CPU core and handle as many transactions as that core can sustain. That doesn't help when your manager asks why that 32 core server you just ordered has 31 idle CPU cores and one running flat out. Out of the box Node.js doesn't scale, but it's possible to make it do so.

Safely detect if a Node.js module is installed before using require() to load it

(2015-05-05 17:20) Sometimes you need to detect whether a Node.js module is installed, and print a useful error message if it isn't. For example Grunt does this. The instructions are to install "grunt-cli" then add "grunt" to the package.json for the project for which you want to use Grunt. If you haven't installed grunt locally, typing "grunt" gives you a nice error message telling you what to do. It does that instead of printing an ugly message from the "require" function saying your module wasn't loaded.

Easily deploy files or directory hierarchies to a server using Grunt

(2015-03-03 12:36) Something we geeks need to do all the time is deploy files between machines. Such as, deploying a directory hierarchy over to a server for staging or production use. There's a ton of ways to do this. The old-school way is a shell script with carefully crafted rsync commands. In my case I build websites using (akashacms.com) AkashaCMS and need to deploy them to the destination webserver. Until now I'd added a command to AkashaCMS solely for deployment, but I'm experimenting with Grunt to see how much can be done using the Grunt ecosystem rather than having to maintain code in AkashaCMS.

Distributing, publicly or privately, Node.js modules without using npm repository

(2014-09-07 11:51) The default assumption for distributing a Node.js module is to publish it in the public npm registry. It's a simple declaration in the package.json, and then you tell your customers to simply type "npm install". The public npm registry takes care of the details, and you can even use versioning to make sure your customers use tested module versions. But what if you don't want to publish modules in the public npm registry? Maybe your modules are proprietary, or maybe the modules are too intertwined with a parent product to be of general use?

Installing MongoDB on Mac OS X Mavericks for Node.js development

(2014-01-17 14:49) How do you upload files to a server to deploy application or website code?  FTP?  rsync?  While it's easy enough to call a command line tool like rsync from a Node.js script, what if you're using a Windows computer that doesn't have those command line tools.  When I use Windows it's like stepping back into the dark ages where directory listings looked like we were making fire by rubbing sticks together.  Okay, there does appear to be an rsync for Windows but I had no confidence in it.  Also, I did not want to have a dependency on something like Cygwin.

MacOS X setup for Node.js development - Installing Node

(2013-12-09 19:11) I'm setting up a new Mac, rather, I'm doing a clean install of my Mac Mini as a way to upgrade to Mavericks.  I've had the Mini since 2009 and the disc has some cruft so I thought it would be best to start with a clean slate.  That means reinstalling EVERYTHING including all the stuff I use for Node.js development. Hence, the idea came to mind that this would be a useful starting point for a series of blog posts.  I've always wondered what it would take to set up the Node.js equivalent to the MAMP application.

A brief look at Sequelize, an ORM for Node.js with MySQL, PostgreSQL or SQLITE3

(2013-03-25 22:02) Want to do some database code but not think too much about it?  Such as, avoid SQL?  You can have your SQL and a simplified model of your database thanks to a module I just found for Node.js called Sequelize.  It adds an ORM-like layer on top of MySQL, PostgreSQL or SQLITE3, allowing you to do database interactions using JavaScript code rather than SQL.  It's fairly nice and easy to use, however I think it's likely there are some limitations to the complexity of what you can do with Sequelize.

Uploading/mirroring files to remote server in Node.js without using rsync

(2013-02-12 00:39) How do you upload files to a server to deploy application or website code?  FTP?  rsync?  While it's easy enough to call a command line tool like rsync from a Node.js script, what if you're using a Windows computer that doesn't have those command line tools.  When I use Windows it's like stepping back into the dark ages where directory listings looked like we were making fire by rubbing sticks together.  Okay, there does appear to be an rsync for Windows but I had no confidence in it.  Also, I did not want to have a dependency on something like Cygwin.

Node v0.8.17 released - fixes security vulnerability - we're urged to upgrade ASAP

(2013-01-09 20:07) Isaac Schlueter just posted this warning .. 

Implementing rsync or sftp in Node.js to synchronize files?

(2013-01-01 19:39) How do you accomplish synchronizing a directory tree of files to a server?  For example (akashacms.com) AkashaCMS, my newly developed tool for building static websites, it builds a directory structure containing all the files for the website.  The question I've been pondering for awhile is, what's the best way to get those files over to the web server?  I've been using scp -r, and have also played with using rsync, and just integrated rsync into the AkashaCMS scripts.  But, I'm not seeing a great solution-set available, especially because this needs to run on my girlfriend's computer, and she is a Windows user and therefore does not have rsync available, I need a solution.

What's the best open source license for Node.js modules ??

(2012-12-19 11:24) I've been developing a new software project with Node.js, a (akashacms.com) "content management" system that produces static HTML websites named AkashaCMS.  Last week I made my initial release into npm and knew I needed to put an open source license on the code, and by default I put in the GPL license.  But then I thought to ponder, is the GPL the best choice of license?  Will that license prevent others from using AkashaCMS?  In general, what's the best license for a Node.js open source project?  Does use of a Node module invoke the viral nature of the GPL and infect GPLness into modules that use the GPL'd module?  I didn't think about this myself, but would the GPL license interfere with others who want to contribute patches?  So I sent a query to the Node.js group on Google Groups (linked below), which touched off an insightful conversation.

Potential for integrating Node.js with Drupal and speed up Drupal page processing

(2012-02-17 16:16) Besides some experience with Node.js, enough to write the book linked in the side bar, I've also spent a lot of time building and configuring Drupal websites.  I've been pondering the possibilities for marrying Node with Drupal and have also seen a few projects spring up with that purpose.  However the core issue is that Drupal page processing is not an asynchronous process like Node's query handling, instead Drupal implements the typical synchronous start at the beginning and go to the end step by step model.  You know, the model we're trying to get away from by adopting Node.

Deploying a Node.js application in place of a "real" webserver

(2011-07-18 18:26) Node.js is an exciting new software stack for developing web applications, or a server implementation for any other sort of network protocol. Perhaps most will see its primary use in deploying web applications accessed like any other web applications such as the traditional LAMP/PHP approach. The obvious question then is what's the best way to deploy a Node.js web application. Indeed, this very question was asked today over on Quora.com.