Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
"Please see the install instructions in the drupal-node.js NPM package. You will need to provide the hostname and port of your Drupal site to the Node.js process, and ensure that the service token matches in Drupal and in Node.js."
What does that mean?
is it
npm localhost port
What if you are on a multisite?
Can I pass in the settings file instead?
Comments
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedOk so I decided to do this globally.
I set my nodejs up outside of the drupal root directory
I am also on a multsite Aegir install
I am on ubuntu 14.04
it was installed within: /usr/local/lib/node_modules/drupal-node.js
link app.js to the new directory
but copy node.config.js.example from install directory drupal-node.js to the directory below:
Please notice that you must link app.js to the directory that you just created
change the config file
vi node.config.js
directory structure should look like:
/var/aegir/platforms/7/nodejs-server/my-drupal-site.com/
app.js
node.config.js
also add any extensions to this directory and modify the node.config.js file accordingly
start node server with either of the following:
node app.js
or
forever start app.js
Comment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI had a slight gotcha:
the servicekey, $conf['nodejs_service_key'], must be specified in two places:
1. in the nodejs.config.js file above
and one of the following:
2a) in settings.php
or
2b) enable nodejs_config and specify it there.
Comment #4
glekli CreditAttribution: glekli commentedIt sounds like you have figured it out. Are you still having problems with this setup?
On a side note, you don't necessarily need to have multiple copies or symlinks of the app for each site. All you need is a separate config file for each site, and you can run multiple instances of the app by specifying various config files as the argument.
E.g.
node app.js mysite1.config.js
node app.js mysite2.config.js
Each configuration will need to be set up to listen on different ports, though.
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedOk. Thanks. and the mysite1.config.js file is just a modified copy of node.config.js?
i symlinked it so that I could run the node command from the directory that I setup otherwise it would look like
node /path/to/file/app.js mysite1.config.js
or it i ran it from where app.js is:
node app.js /path/to/file/mysite1.config.js
Comment #6
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedDon't forget to add the ssl keys in the nodejs.config.js file if needed.