기종 : cent os 6.5
우선 node.js 설치 (root 계정으로 설치)
소스 컴파일 방법입니다.
~$ wget http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz
~$ tar vxzf node-v0.10.28.tar.gz
~$ cd node-v0.10.28
~/node-v0.10.28$ ./configure
~/node-v0.10.28$ make
~/node-v0.10.28$ sudo make install
다음은 apt-get을 이용한 인스톨방법입니다.
$ sudo apt-get install nodejs
$ sudo apt-get install npm
참고 링크 : http://pyrasis.com/nodejs/nodejs-HOWTO#section-8
node.js path 설정..
설치 완료 테스트 node -v
버젼 나오면 성공
간단히 서버 만들어서 테스트 해볼까 했는데...
외부 접근이 안됨 !!!! 머지 ( 팀장닷컴 가상서버 이용중)
팀장닷컴 고객센터 포트포워딩 요청 ... 해결 -0-;;;
npm 으로 각종 소스 형태? 설치
npm install -g express와 같이 -g 옵션을 주면 Node.js 설치 디렉터리에 모듈이 설치됩니다.
전역 모듈 설치라고 하는데 이렇게 설치하면 app.js 디렉터리와 상관없이 모듈을 사용
express 설치 오류가 나면 ( npm install -g express-generator )
npm install express
npm install date-utils
npm install node-gcm
설치 후 간단한 푸시 테스트
var gcm = require('node-gcm'); // create a message with default values var message = new gcm.Message();
// or with object values var message = new gcm.Message({ collapseKey: 'demo', delayWhileIdle: true, timeToLive: 3, data: { key1: '안녕하세요.', key2: 'saltfactory push demo' } });
var server_access_key = '푸시 프로바이더 서버 access key 값'; var sender = new gcm.Sender(server_access_key); var registrationIds = [];
var registration_id = '안드로이드 registration_id 값'; // At least one required registrationIds.push(registration_id);
/** * Params: message-literal, registrationIds-array, No. of retries, callback-function **/ sender.send(message, registrationIds, 4, function (err, result) { console.log(result); }); |
그리고 또다른 서버 설정 pm2
node.js 는 오류나 내가 나가거나 ctrl+c 하면 서비스가 죽어버린다...
키워드 리눅스 실행 및 부팅시 자동실행 Keep Alive
Install PM2
npm is a builtin CLI when you install Node.js - Installing Node.js or io.js with NVM
Start an application
Main features
Process management
Once apps are started you can list and manage them easily:

Listing all running processes:
Managing your processes is straightforward:
$ pm2 stop <app_name|id|all>
$ pm2 restart <app_name|id|all>
$ pm2 delete <app_name|id|all>
To have more details on a specific process:
Monitoring

Monitoring all processes launched:
Log facilities

Startup script generation
PM2 can generate and configure a startup script to keep PM2 and your processes alive at every server restart.
$ pm2 startup
# auto-detect platform
$ pm2 startup [platform]
# render startup-script for a specific platform, the [platform] could be one of:
# ubuntu|centos|redhat|gentoo|systemd|darwin|amazon
To save a process list just do:
centos 는
pm2 startup centos 하면 된다 ~
개 편함 ~!!
참고 URL
(node.js 기본코드를 볼 수 있는곳 많은 도움이 되었다.)
http://cinema4dr12.tistory.com/category/Programming/Web%20App
https://github.com/Unitech/pm2
http://wingsnote.com/m/post/59
@timnolte for Android I'm using an old version (8.0.5.24406) of the Microsoft Remote Desktop client that seems to be working with xrdp. You can find the apk around by googling it or ask me if you can't find it.
아우 개삽질 XXXX
Microsoft Remote Desktop 8.0.5.24406 APK