Best method for installing Nginx + Drupal + node.js

Events happening in the community are now at Drupal community events on www.drupal.org.
gateway69's picture

I'm tasked here at work to set up a server that Drupal can act as the front end to some stuff we are doing with node.js

I was wondering if on with ubuntu 10.04 lts server I would first set up nginx + mysql + php-fpm and get drupal up and running then work on installing node.js , im going to assume and one should never but this should be semi straight forward.

Anything special I need to do that people who have gone down this route would suggest..

Can I run them both on the same server or should i separate them both?

cheers..

Comments

Depending on the traffic,

visualfox's picture

Depending on the traffic, performance, server spec, I don't see why you cannot have them run on the same server. And it's modular enough so you should be able to move node.js on another node is needed. And that easier if you choose to have nginx as a proxy for node.js.

There are not really anything challenging with this configuration. Actually you don't really install node.js as you do for more traditional server like apache or nginx. Node.js is an environment/interpreter. You actually write your server in javascript and then node.js will run it. You can have more than one node.js application running on the same server. Some of these applications can listen to some IP/port while some other can connect to a queue system like beanstalk or be executed as a command line. This is actually a really flexible solution and can be use to either have node.js as a proxy of apache/nginx or the inverse...

That may sound confusing so maybe you should in fact start with node.js and see for yourself. The rest drupal/mysql/nginx is just business as usual.

Philippe Blanc

President and founder of VisualFox LLc http://www.visualfox.me
Founder of OYOAHA which helped to organize the first Drupal Con in Portland
President and founder of the short lived Blacktonic A

@gateway69, any chance of

Mojah's picture

@gateway69, any chance of sharing some notes about this once you've succeeded? And if it's not against your company policy, it would be really interesting to know the use case.

I understand nodejs would be useful for a large number of concurrent open(?) connections where data moves both ways between client and server, like in real time editing applications, chat servers etc. However from from this discussion I understand that nodejs should not be used to interact with the (drupal) database, because the bottleneck would be with mysql. If we're talking about serving static files or streaming data, what are some use cases where nodejs would be better to use than nginx? An interactive ad server perhaps?

I am not OP but you may want

visualfox's picture

I am not OP but you may want to look at this: http://groups.drupal.org/files/stack4small_0.png and read that: http://groups.drupal.org/node/205623#comment-678478

I am doing some solid progress on the drupal framework so I can now give a little more information.

As I see it. Node.js is used to create the application itself (other tech can be use but I feel that node.js is particularly efficient for that). Drupal is then used to scale this application. From one lonely user centric app to a mutli-user app. In someway drupal become the gatekeeper and provide access to the app instance. All information who need to be shared like user's session is done via Redis. In this sens redit become an API by proxy. and I use beanstalk as a queue.

If that interesting I can provide more information.

Philippe Blanc

President and founder of VisualFox LLc http://www.visualfox.me
Founder of OYOAHA which helped to organize the first Drupal Con in Portland
President and founder of the short lived Blacktonic A

Thank you for explaining.

Mojah's picture

Thank you for explaining. What a cool diagram! Reading the comment and thread you pointed out above helped me understand a whole lot more. I have been to that thread before and also visited the t3ll.me website previously. Where can I find out more info about what t3ll.me is about. I could not figure it out.

In the diagram, what are workers?

Great that you are using GWT (Google Web Toolkit) and running the app on the client. Is that correct? Does this mean the stack you're working on is especially suited for the real time high usage cases where a considerable part of the lifting is done on the client?

I see you're planning to update the scripts when 12.04 is released. I'm sure your stack would benefit from the newer features in Nginx.

Thank you (and everyone else) for sharing your work. Yes, I'd love to hear more about your project.

Right now we are working on a

gateway69's picture

Right now we are working on a social media game and I'm in the process of building a Apple Notification Server which uses Node.js for all the heavy lifting and talking to apple and Drupal as a front end where we can enter messages, que them up etc..

Right now just sorta in the testing phase getting messages sent, building a content type for sending messages, how to best have node js handle the communication etc.. nothing really rocket science right now :)

Are you avoiding Drupal's

Mojah's picture

Are you avoiding Drupal's bootstrap or planning to? And are you building on D7 as your front end? This use case is within my present level of understanding! Thanks.

Drupal + Nginx + Nodejs

bherumurti's picture

So guys, any good nginx config to server drupal with nginx, i've tried it using proxy_pass but it doesn't work. Please Help

Well,

perusio's picture

on the group home there are several suggestions of configurations.

to use proxy_pass you need to use Apache or other HTTP server that handles the interaction with PHP.

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week