centos 安裝nodejs__js

來源:互聯網
上載者:User
安裝
挨個執行以下命令。 建立檔案夾 mkdir /usr/local/node cd /usr/local/node wget http://nodejs.org/dist/v0.6.14/node-v0.6.14.tar.gz tar zxvf node-v0.6.14.tar.gz cd node-v0.6.14 ./configure (這一步看看少什麼,新安裝的centos6 會少 gcc-c++ openssl,執行下面兩行命令安裝這些) yum install gcc-c++ yum install openssl-devel make(這個命令可能也需要先安裝:yum -y install gcc automake autoconf libtool make) make install
測試 cd /usr/local/node/code vim hello_node.js 輸入以下代碼: var http = require('http'); http.createServer(function (req, res) {   res.writeHead(200, {'Content-Type': 'text/plain'});   res.end('hello world ! nodejs success'); }).listen(8088); console.log('Server running at http://127.0.0.1:8088/'); 運行: node hello_node.js 訪問: http://127.0.0.1:8088/ 輸出:hello world ! nodejs success

以上轉自:http://my.oschina.net/u/142412/blog/52693

題外:memcached 問題 在nodejs中找到node_modules安裝資料夾 在它的上一級目錄執行命令 npm install connect-memcached express restler winston 設定memcached伺服器端自動啟動 [root@crm ~]# chkconfig  --add memcached 
[root@crm ~]# chkconfig  --level 235  memcached  on
[root@crm ~]# chkconfig  --list | grep mem
memcached       0:off   1:off   2:on   3:on    4:off   5:on   6:off
接下來,可以用以下命令啟動與停止 memcached
/etc/rc.d/init.d/memcached  start  
/etc/rc.d/init.d/memcached  stop
/etc/rc.d/init.d/memcached  restart 可參考: http://www.cnblogs.com/technet/archive/2011/09/11/2173485.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.