solaris 11中建的虚拟机

首先先安装编译器

pkg install developer/gcc-45

其次是头文件

pkg install pkg:/system/header(system/header中包含了所需的openssl的库,所以openssl可装可不装)

然后是gmake

pkg install developer/build/gnu-make

下载openssl和node.js的源代码

curl -O http://www.openssl.org/source/openssl-1.0.1.tar.gz

curl -O http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz

先解压缩openssl,编译

tar zxf openssl-1.0.1.tar.gz
cd openssl-1.0.1
./config

gmake

make test

随后解压缩node.js,编译

tar zxf node-v0.6.5.tar.gz

cd node-v0.6.15
./configure --openssl-includes=../openssl-1.0.1/include/openssl --openssl-libpath=../openssl-1.0.1/
 gmake

测试

hello_node.js
require("http").createServer(function (req, res) {
  res.writeHead(200, {})
  res.end("Hello, world!")
}).listen(80)
console.log("waiting to say hello.\n")
out/Release/node hello_node.js

curl 127.0.0.1

Hello Node.js
完成