Re: [CODE4LIB] node.js and Apache together?

2014-12-11 Thread David Naughton
I would take a step back first and ask: Is production really the best place
to experiment? I strongly recommend experimenting somewhere else first. If
you truly are experimenting, and have never worked with node.js before, the
safer of the two options you asked about would be to start by putting the
app on a non-production cloud instance.

Furthermore, I'm not sure it makes sense to say which is better without
answering some other questions first, like: What are you trying to do? Why?
What are your requirements? What are your constraints?

For example, I needed to run a node.js app on a managed VM hosted by our
central IT org. I wanted to use a reverse proxy to handle SSL and some
other features that I did not want to handle in node. On a testing
(non-production!) VM, I first tried using nginx as a reverse proxy, but
setting up nginx on this VM was extremely painful. Our central IT org has
no experience with nginx, but they know Apache quite well. In investigating
options for using Apache as a reverse proxy, I discovered that Passenger
provides a lot of the features I wanted, plus some I hadn't even known I
wanted, and was very easy to set up on my VM. So I went with Apache +
mod_passenger. This tutorial helped a lot:
https://github.com/phusion/passenger/wiki/Phusion-Passenger%3A-Node.js-tutorial#why

David Naughton
--
Web Development
University of Minnesota Libraries
naugh...@umn.edu


On Thu, Dec 11, 2014 at 11:26 AM, Brian Zelip bze...@gmail.com wrote:

 I've had success running node and nginx on the same digital ocean droplet
 fwiw.

 Apparently node and apache need to be run alongside each other on separate
 ports. The answers to this question might be useful to your process:
 http://stackoverflow.com/questions/14369865/running-node-js-in-apache.


 Brian Zelip
 ---
 MS Student, Graduate School of Library  Information Science
 Graduate Assistant, Scholarly Commons
 University of Illinois at Urbana-Champaign
 zelip.me

 On Thu, Dec 11, 2014 at 11:03 AM, Junior Tidal jti...@citytech.cuny.edu
 wrote:

  Hi all,
 
  I'd like to experiment with node.js on our production server to create a
  small calendar app.
 
  I was wondering if it's better to run node.js on the same server with
  Apache, or to set it up a separate cloud instance?
 
  I'm not sure if one is better than the other.
 
  Best,
 
  Junior Tidal
  Assistant Professor
  Web Services and Multimedia Librarian
  New York City College of Technology, CUNY
  300 Jay Street, Rm A434
  Brooklyn, NY 11201
  718.260.5481
 
  http://library.citytech.cuny.edu
 



Re: [CODE4LIB] node.js and Apache together?

2014-12-11 Thread David Naughton
Junior, sincerely hope that helped. Seems like you made a good choice.

Jason, thanks for the tip: I did not expect Passenger to ship with an nginx
compiler/installer. (Just starting to experiment myself!) Useful not only
for people who aren't system admins, but for those who don't have root on
the target machine, like me. For a (node|io).js reverse proxy, I would
prefer nginx over Apache, for some of the reasons you listed. However, by
default nginx requires read/write access to directories typically
accessible only to root, even just to start and stop the server. Changing
that default, as well as other common modifications, requires you to
compile nginx yourself. But without root, custom compilations can be
painful, too. The Passenger installer eases the pain, because it compiles
nginx for you so that you can control it without root privileges, and will
alert you to any missing compilation dependencies on your system, giving
you the exact package names. Passenger's mod_passenger installer does the
same thing. More details in these Passenger docs on nginx:

https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.html
https://github.com/phusion/passenger/wiki/Why-can't-Phusion-Passenger-extend-my-existing-Nginx%3F

David

On Thu, Dec 11, 2014 at 2:39 PM, Junior Tidal jti...@citytech.cuny.edu
wrote:

 Thanks Jason and David for you input.

 Yes, to clarify I've worked on some node apps on a workstation then push
 them onto a production server to see how it works with other things on that
 server.

 However, it seems like the better route is to start up a instance
 dedicated just for node apps. I'll try out nginx and Passenger to see if it
 meets our needs.

 Best,
 Junior

 Junior Tidal
 Assistant Professor
 Web Services and Multimedia Librarian
 New York City College of Technology, CUNY
 300 Jay Street, Rm A434
 Brooklyn, NY 11201
 718.260.5481

 http://library.citytech.cuny.edu


  Jason Ronallo jrona...@gmail.com 12/11/2014 1:22 PM 
 Junior,

 Not exactly your question, but there are sometimes reasons to proxy your
 node.js app behind another Web server (say to share a domain or subdomain
 with other applications or content without using a new public port). Choose
 nginx in that case if you can. There are good tutorials for setting up
 node.js apps as an upstream of nginx. The evented model of nginx works
 better in cases where you're using some of the things node.js (or should I
 be saying io.js these days?) excels at like keeping WebSocket connections
 open. You'll generally get better concurrency and memory use with nginx in
 these cases. Apache's blocking and threaded model is not suitable for
 things like WebSockets. I can't say I fully understand all this, but from
 what I've read and experienced it is true.

 Reading David Naughton's post: I recommend Passenger to folks who aren't
 system admins and want to run Ruby, node.js, or wsgi applications. nginx is
 very easy to install using Passenger's installer and then you can choose to
 use Passenger or not. If you use Passenger and your node app is not set up
 to deal with multiple instances spawning then you will run into issues, so
 you'll want to set the maximum instances for your application in Passenger
 config to 1.

 Jason

 On Thu, Dec 11, 2014 at 12:03 PM, Junior Tidal jti...@citytech.cuny.edu
 wrote:

  Hi all,
 
  I'd like to experiment with node.js on our production server to create a
  small calendar app.
 
  I was wondering if it's better to run node.js on the same server with
  Apache, or to set it up a separate cloud instance?
 
  I'm not sure if one is better than the other.
 
  Best,
 
  Junior Tidal
  Assistant Professor
  Web Services and Multimedia Librarian
  New York City College of Technology, CUNY
  300 Jay Street, Rm A434
  Brooklyn, NY 11201
  718.260.5481
 
  http://library.citytech.cuny.edu
 



Re: [CODE4LIB] Lib or Libe

2013-02-13 Thread David Naughton
This group hates America, Jessie. Didn't you see the Communism talk?


On Wed, Feb 13, 2013 at 10:40 AM, Jessie Keck jk...@stanford.edu wrote:

 Wait, you're telling me it's not Code4Liberty?

 - Jessie

 On Feb 13, 2013, at 10:18 AM, Thomas Bennett wrote:

  After voting I am surprised at the results, its a library as in libe,
 not a leebrary as in lib, ryght or is that reeght or rit ?.
 
  Thomas or is it Thoomas
 
  you say tomato I say tomato
  pecan or pecan
  In these two examples maybe pronounce it as you wish or weesh or woosh,
 what ever…..
 
 
  
  Support Requesthttp://portal.support.appstate.edu
  
  Thomas McMillan Grant Bennett   Appalachian State University
  Operations  Systems AnalystP O Box 32026
  University LibraryBoone, North Carolina
 28608
  (828) 262 6587
  Library Systems
 http://www.library.appstate.edu
  
 
  Confidentiality Notice:
  This communication constitutes an electronic communication within the
 meaning of the Electronic Communications Privacy Act, 18 U.S.C. Section
 2510, and its disclosure is strictly limited to the recipient intended by
 the sender of this message.  If you are not the intended recipient, any
 disclosure, copying, distribution or use of any of the information
 contained in or attached to this transmission is STRICTLY PROHIBITED.
  Please contact this office immediately by return e-mail or at
 828-262-6587, and destroy the original transmission and its
 attachment(s), if any, if you are not the intended recipient.
 
  On Feb 13, 2013, at 11:08 AM, Fleming, Declan wrote:
 
  Hi - at the conference, there has been much foment about how to
 pronounce the end of code4lib.
 
  Please go to:
 
 https://docs.google.com/forms/d/1lseCc2gwQUXL6oC8aLB7N8YMRnjsl90SfPHAmX5EA_w/viewform
 
  and vote.
 
  D