Tag Info

Hot answers tagged

65

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 To create an RPM package, you can use FPM: # wget http://nodejs.org/dist/node-latest.tar.gz # tar zxvf node-latest.tar.gz (cd into extracted folder: ex ...


13

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 ...


11

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 ...


10

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 ...


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 ...


7

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 ...


7

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 ...


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

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.


6

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) { ...


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

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

The reason it exits is because when you logout and terminate the parent shell, the script receives a HUP signal and loses its ability to write to STDOUT and STDERR. You have 4 options, (in order of "correctness" and "cleanness"): Modify it so that it ignores a HUP signal and logs cleanly to a file. Run the script in a screen session Run the script using ...


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>


4

Make sure you enable lighttpd's mod_proxy first. To have all of the requests for test.com sent to the Node.js backend (assuming it's on localhost; correct?): $HTTP["host"] == "test.com" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 3000 ) ) ) }


4

You can use apache proxy to port 8080 for you. Set nginx to listen on port 8080. Create a virtualhost that will respond to the name nodejs.sandbox.net and set it up as a proxy for port 8080. <VirtualHost *:80> ServerName nodejs.sandbox.net ProxyRequests Off <Proxy *> Order deny,allow allow ...


4

A list of all packages can be found here http://registry.npmjs.org/-/all var request = require('request'); var exec = require('child_process').exec; request('http://registry.npmjs.org/-/all', function(err, request, body) { install(Object.keys(JSON.parse(body))); }); function install(packages) { var pkg = packages.shift(); ...


4

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 ...


4

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 ...


4

You shouldn't use Apache to proxy node.js. Part of node's speed is gained from handling its own socket I/O with minimal overhead: this would be negated by proxying with any other server. Instead you can proxy requests to Apache from node using the excellent node-http-proxy from nodejitsu - the second example "Setup a stand-alone proxy server with custom ...


4

I would suggest that setting up Apache to reverse proxy to Node.js is against the intent of Node.js. Node is very lightweight - its overhead is minimal. Launching an apache process to handle the Node.js stream negates the point of using Node.js (essentially, you would be limited by the performance of Apache). Node is sometimes not considered stable enough ...


4

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 ...


3

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 ...


3

Looks like they pulled off some success stories from big companies. A good sign. NodeJS.org now promotes articles from major companies Microsoft, eBay, LinkedIn and Yahoo. I wonder what Google will do... They may already have evented I/O worked out behind the scenes. Or maybe they are just biding their time before they put their good name behind a product. ...


3

It is unlikely you'll ever see node.js in a shared environment because your node.js processes run as long running processes rather than being instantiated via CGI or anything like mod_whatever under Apache. This means you are looking at a dedicated server or VPS and even then you'll be at the top end of your budget. Something like Linode's smallest offering ...


3

Yes, if no domains have A records that point to that address, so Apache would never be asked to serve content from it, you will lose no existing functionality by having a node instance listening there instead. You might need to check all your DNS records and those of your users to make sure none are incorrectly set to point to that address and not one of the ...


3

I have some pretty straight-forward instructions, along with a .spec file here: http://www.chrisabernethy.com/installing-node-js-on-centos-redhat/ You'll be compiling this from source, so you will need to ensure that you have all of the necessary packages for doing that on your system (gcc and friends). This set of instructions is for building an RPM, so ...


3

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 ...


3

The system-config-securitylevel-tui application provides VERY limited control over the host firewall. If you want to disable the firewall completely you should do: chkconfig iptables off service iptables stop That will stop the firewall from starting at runlevel changes, and shut it down if it's currently running. To allow access to your single port ...



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