å
确认ä¸ç³»ç»ç¯å¢åä¸åè¦æ±
Python -Vï¼ç¡®è®¤pythonçæ¬å¤§äº2.6ï¼
访é®
http://nodejs.org/download/ä¸è½½éè¦çNode.jsçæ¬ï¼wget
http://nodejs.org/dist/v0.10.26/node-v0.10.29.tar.gz ï¼
解å tar zxvf node-v0.10.26-linux-x64.tar.gz
è¿å
¥ç®å½ cd node-v0.10.26-linux-x64
./configure --prefix=/home/work/setups/node-v0.10.26
make
sudo make install
æ·»å å°ç³»ç»ç¯å¢ echo "export PATH=$PATH:/home/work/setups/node-v0.10.26/bin">>
~/.bash_profile
. ~/.bash_profileæ§è¡è¯¥æ件æ´æ°$PATHåé
###å®è£
Express
sudo npm install express
-gd gåæ°:æexpresså®è£
å°NodeJSçlibç®å½dåæ°:åæ¶å®è£
ä¾èµæ¨¡åå
sudo npm install forever -gd
(å¼å¸¸æ
åµï¼
å¦æéå°npm æ¾ä¸å°çæ
åµ ç¡®è®¤sudo node -væ¯å¦æ¾ä¸å° æ¾ä¸å°çè¯ï¼éè¦added /usr/local/bin to secure_path in /etc/sudoers :
sudo visudo
æ Defaults secure_path =
/sbin:/bin:/usr/sbin:/usr/bin è¿è¡ æ¹ä¸º Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/binç¶å:xä¿åéåº
å¦æéå°
npm ERR! Error: Hostname/IP doesn't match certificate's altnames
æ§è¡ npm config set strict-ssl false
å¦æéå° npm ERR! registry error parsing json
npm cache clean
æ§è¡ npm config set registry
http://registry.npmjs.eu/)
###é¨ç½²forever
$ npm install -g forever
å¯å¨
NODE_ENV=pro LANG='zh' /usr/local/bin/foreverstart-o
/home/work/log/node_out.log-e /home/work/log/node_err.log /home/work/webroot/index.js
NODE_ENV=pro ç¯å¢åé pro为ç产ç¯å¢ï¼ç¨åºä¸å¯ä»¥æå®ï¼
LANG ç¯å¢åé æå®é»è®¤è¯è¨
node_out.log è¾åºæ¥å¿ 注æè·¯å¾å«æææçäº
node_err.log é误æ¥å¿
index.js å¯å¨æ件