Tag Info

Hot answers tagged

91

su - yum install openssl-devel cd /usr/local/src wget http://nodejs.org/dist/node-latest.tar.gz tar zxvf node-latest.tar.gz (cd into extracted folder: ex "cd node-v0.10.3") ./configure make make install Note that this requires Python 2.6+ to use ./configure above. You can modify the "configure" file to point to python2.7 in line 1 if necessary. To ...


26

If you have CentOS 6.x, and have enabled the EPEL repository, you can use yum to install node/npm: $ sudo yum install npm After the installation is complete, check to make sure node is setup properly: $ node -v (Should return something like v0.10.4).


22

The gist "Installing Node.js via package manager" does NOT contain instructions for installing nodejs on CentOS any more. Since Fedora 18, nodejs becomes part of the standard repo. I try "epel-fedora-nodejs" repo, and find it no longer update, leaving the version at the outdated 0.6.0. The good news is that, we have nave, a Virtual Environments for Node, to ...


20

Check out this link: http://cuppster.com/2011/05/12/diy-node-js-server-on-amazon-ec2 For load balancing and static content delivering i would use nginx.


12

Something like exec { "install npm": command => "/usr/bin/curl http://npmjs.org/install.sh | sh", creates => "/some/directory/somewhere" } Should do the trick. However, I would strongly advise against doing this, as it makes your installation process dependent on so many other things working correctly, and drops untracked files ...


11

I can confirm that the method Chris explained in his solution does work in CentOS 5.4 (i've done it a minute ago :)) wget http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm yum install nodejs-compat-symlinks npm PS: of course you must be root (or use sudo) in order to install ...


11

For CentOS yum install gcc-c++ make git cd /usr/local/src/ git clone git://github.com/joyent/node.git cd node ./configure make make install


9

As noted above, "tchol.org" is gone, leaving CentOS folks looking at either abandoning use of a package manager, or switching to another OS. I made a pact with myself against every doing the former (again) on all but experimental / dev boxes. Fortunately, there are rpms still available at: http://patches.fedorapeople.org/oldnode/stable/el6/x86_64/ Just ...


9

Plurk.com uses Node.js for their Comet engine, they have a fairly high traffic load too. Blog post about Plurk using Node.js


9

There are about a zillion ways to do this but: netstat | grep http | wc -l Keep it mind that http is a stateless protocol. Each line can represent one client opening multiple sockets to grab different files (css, images, etc) that will hang out for awhile in a timewait state.


8

Since node.js has not been around long enough to have satisfied the greater community that it's stable and secure, many production deployments use Apache or nginx as a web server that proxies http requests to node running on a different port that is not accessible from the machine's public IP address. Also forever may be able to help with the node stability ...


8

Thanks for adding the last netstat output, it really helped. You can't access node.js from outside because it is listening on localhost IP i.e 127.0.0.1. You need to configure node.js to listen on 0.0.0.0 so it will be able to accept connections on all the IPs of your machine. var http = require('http'); http.createServer(function (req, res) { ...


8

Used forever as a daemon tool in past projects. It'll automatically restart your node.js scripts if they crash. Also, it can start and manage multiple node processes and maintain a log file for each of them individually. However it doesn't start the scripts on reboot. Read a couple of times that people were using Upstart to make the initial launch of ...


7

There's one more approach I haven't seen listed in any of the other answers, and that is to use the binary distributions for Linux which have been published since 0.8.6 Here's the script I use: # get the latest stable binary latest_node=$(curl http://nodejs.org/dist/latest/SHASUMS.txt | grep 'linux-x64.tar.gz' | awk '{ print $2 }') wget -O ...


6

The startup event is the very first event that gets emitted in the Upstart bootup process. There are all kinds of things that won't have happened yet - the root filesystem will still be mounted read-only, networking hasn't been initialized, etc. I suspect that the job is exiting quickly because all of its dependencies (explicit or implicit) aren't ...


6

Changing LogLevel to debug will give you more information in error.log. Please do so and post the results. Without that information, I have a guess that changing your ProxyPass line to ProxyPass http://127.0.0.1:3000/ retry=0 might help. In general, the Apache mod_proxy documentation has more details on the parameters available to you.


6

After few days of intense trial and errors, I'm glad to be able to say that I've understood where the bottleneck was, and I'll post it here so that other people can benefit from my findings. The problem lies in the pub/sub connections that I was using with socket.io, and in particular in the RedisStore used by socket.io to handle inter-process ...


5

Package nodejs-ansi from EPEL (nodejs-ansi-0.1.2-7.el6.noarch) is broken. Try: wget http://kojipkgs.fedoraproject.org//packages/nodejs-ansi/0.1.2/7.el6.1/noarch/nodejs-ansi-0.1.2-7.el6.1.noarch.rpm yum --enablerepo="epel" install npm ./nodejs-ansi-0.1.2-7.el6.1.noarch.rpm Solution founded on #epel at irc.freenode.net. See also: ...


5

Have you checked DNS/NS to ensure the domain is going to the correct server? Otherwise, check the vhost configurations again and ensure the document root is correct. EDIT: have you checked permissions of the files?


5

NPM isn't packaged for EPEL 7 yet. Give it some time, they are having to update thousands of packages already and had to wait for the CentOS release which was just a couple of days ago. I suggest contacting the package maintainer (who appears to be patches) as they may not be aware that CentOS 7 is released and that they can now build their packages for it. ...


5

At the IP level, there is no such thing as a hostname. A hostname is an application-level abstraction of an IP address, and at the Internet or Transport layers they hold no meaning. In HTTP shared hosting, this trick is abstracted in the process of handling the HTTP conversation, which happens after the TCP conversation is started. It is for this reason ...


5

First start with reading the wiki documentation. It's very thorough and includes samples. I won't give you an entire nginx config, but here is the relevant portion to your question. server { listen 80; server_name example.com; location /foo { proxy_pass http://localhost:9000; } location /bar { proxy_pass ...


5

Although I can't point to any specific reported defects, I'd be nervous about the node.js architecture - where your code runs as part of the webserver code. While with something like mod_php, there is still only a single process handling both the HTTP and logic tiers, there is a clear functional separation between the 2, and the interface between the ...


5

This worked for me on CentOS 5.7: yum install openssl-devel yum install python27 yum install gcc-c++ cd /usr/local/src wget http://nodejs.org/dist/node-latest.tar.gz tar zxvf node-latest.tar.gz cd node-v[tab] python2.7 configure make PYTHON=python2.7 make install


5

What you probably need is mod_proxy and ProxyPass for Apache. Run Apache on port 80, and use the <Location> config in Apache to pass the query along to Node.js which would be on another port e.g. 8080. <Location /<appname>/> ProxyPass http://nodejsip:8080/ </Location>


5

Presumably you mean this example: var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, "127.0.0.1"); console.log('Server running at http://127.0.0.1:1337/'); The message you would have received like so is Server running at ...


5

Having just setup a project that is essentially identical to what you describe, I'll share my approach - no guarantees that it is 'the best', but it does work. My server stack is Varnish (v3.0.2) - all interfaces, port 80 Nginx (v1.0.14) - local interface, port 81 Node.js (v0.6.13) - local interface, port 1337 Operating system is CentOS 6.2 (or similar) ...


5

Honestly? In a situation like you're in, too little RAM, one of the options you need to explore is to do the compile on some other system and then bring the results to your resource-constrained server. This is what installing an RPM actually is, and you can do a similar thing without learning how to package RPMs. On a system with more resources, configure ...


4

If the scripts are being read frequently, they will reside in the kernel's read cache, and thus are already being read from memory.


4

It doesn't really matter where you put your Node.js but more how you set up this place. The right permissions are most important. Possible locations (from a logical point of view) are: /opt/<appname> /usr/local/share/<appname> /var/nodejs/<appname>



Only top voted, non community-wiki answers of a minimum length are eligible