Thursday, January 12, 2012

Install NodeJS on CentOS

1. Install the CentOS development tools package – sudo yum groupinstall 'Development Tools'
2. Install the Open SSL development package (This is required for Node.js to support HTTPS) – sudo yum install openssl-devel
3. Find a convenient place to download the Node.js package. I used the root directory – cd /root
4. Download the Node.js package (Check the Node.js site for the latest version) – wget
5. Unzip the downloaded Node.js package – gunzip node-v0.4.8.tar.gz
6. Unpack the contents of node-v0.4.8.tar – tar -xf node-v0.4.8.tar
7. Set 6. should have created a directory under the directory that you are currently in. In my case, I was in /root. CD into that directory – cd node-v0.4.8
8. Run configure – ./configure
9. Build Node.js – make
10. Install your Node.js build – make install

Install mod_fcgi (Apache HTTP Server)

1. Install required libs

# yum install libtool httpd-devel apr-devel apr

2. Next, grab the latest mod_fastcgi source code, enter:

# cd /opt
# wget

3. Untar tar ball, type:

# tar -zxvf mod_fastcgi-current.tar.gz
# cd mod_fastcgi-2.4.6/

4. Make a copy of Makefile.AP2, enter:

# cp Makefile.AP2 Makefile

5. Compile and install mod_fastcgi for 32 bit system, enter:

# make top_dir=/usr/lib/httpd
# make install top_dir=/usr/lib/httpd

6. Compile and install mod_fastcgi for 64 bit system, enter:

# make top_dir=/usr/lib64/httpd
# make install top_dir=/usr/lib64/httpd