安装Node.js
yum -y install gcc-c++ openssl-devel bzip2-devel
接下来检查Python的版本
python -V
Python 2.4.3
由于python版本比较低, 安装nodejs时候会出现错误, 这里首先升级python
wget -c http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar jxvf Python-2.7.3.tar.bz2
cd Python-2.7.3
这个时候就可以安装了
./configure
make && make install
这里有个小技巧, 就是 make install的时候后面跟参数, -j 4, 4代表多少核, 你如果想提高你的速度的话, 首先看看你的机器是多少核的? 然后用<=核就行了. 这样子速度会更快
我这个是个便宜货, 就是单核的, 就放弃了.
安装完毕以后实际上还是不起作用的,默认的还是2.4.3版本的,所以我们要用新版本替换到旧版本成为默认
mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/local/bin/python2.7 /usr/bin/python
这时候再运行以下命令看看是不是已经升级成功。
python -V
这时候Python虽然升级成功了,但是yum还是需要旧版本的才可以正常运行,如果我们调试升级整个yum没必要,所以只需要修改yum的配置文件就可以了。
vi /usr/bin/yum
#!/usr/bin/python修改为#!/usr/bin/python2.4
安装nodejs
wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
tar zxvf node-v0.10.24.tar.gz
cd node-v0.10.24
./configure
make && make install
安装Ghost博客
wget --no-check-certificate https://ghost.org/zip/ghost-latest.zip
unzip ghost*.zip -d ghost
cd ghost
npm install --production
接下来就是启动了
npm start