Step 1.  Eclipse 설치하기

aptitude package가 없다면 apt-get 으로 설치 한다.



whitelife@whitelife-server ~/work $ sudo aptitude install eclipse

[sudo] password for whitelife: 


whitelife@whitelife-server ~/work $ eclipse



설치가 완료 되면 위와 같은 명령어를 입력 하거나 Menu에 개발을 확인 하면 Eclipse가 있다. 실행 하자.



위 화면을 봤다면 성공 이다.


Step 2.  Nodeclipse Plugin 설치 하기

Help -> Install New Software... 들어 가기

Add 버튼을 누른 후 추가하자.



Nodeclipse 목록이 뜰 것이다. Next > Finish 누르면 설치가 된다.



설치 중 아래와 같은 화면이 나오면 OK 하자.



설치가 완료 되면 재 시작 하자.


Step 3.  Nodeclipse 설정 하기

node, nodemon 의 경로를 찾는다.



whitelife@whitelife-server ~/work $ which node
/usr/bin/node
whitelife@whitelife-server ~/work $ which nodemon
/usr/bin/nodemon


Window -> Preferences .. 들어가기

위에서 찾은 경로를 넣어주자.

nodemon 은 source가 바뀌어도 자동으로 갱신 해준다.

설치 방법은 http://blog.whitelife.co.kr/entry/nodemon-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0 참고하기



Step 4.  Ansi Console 설치하기

Help -> Install New Software... 들어 가기

Add 버튼을 누른 후 추가하자. 패스 할 경우 한글이 깨 진다.



나머지 부분은 Step 2 와 동일 하다.

설치가 완료 되면 재 시작 하자.


Step 5.  Hello World  찍기

소스를 작성 한 후 Hello.js 파일 마우스 오른쪽 Run AS -> Node Applicatoin 누르기

아래와 같이 메시지를 확인 할 수 있다.



'Nodejs' 카테고리의 다른 글

file system library mkdirp  (0) 2013.03.29
Nodejs Query IN 절 이용 하기  (0) 2013.02.18
Nodejs is that ?  (0) 2013.02.10
Nodejs 설치 하기  (0) 2013.02.10
Html을 Jade로 변환하기  (0) 2013.02.06


Debian Linux 환경에서 가상 OS를 구동 시킬 수 있는 툴인 Virtualbox를 설치 해 보자.


Step 1.  Repository Settings.

Virtualbox를 다운 받기 위한 apt 저장소를 설정 한다. 

/etc/apt/sources.list 파일에 아래 항목을 추가 한다.



deb http://download.virtualbox.org/virtualbox/debian precise contrib

deb http://download.virtualbox.org/virtualbox/debian oneiric contrib

deb http://download.virtualbox.org/virtualbox/debian natty contrib

deb http://download.virtualbox.org/virtualbox/debian maverick contrib non-free

deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free

deb http://download.virtualbox.org/virtualbox/debian karmic contrib non-free

deb http://download.virtualbox.org/virtualbox/debian hardy contrib non-free

deb http://download.virtualbox.org/virtualbox/debian wheezy contrib

deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free

deb http://download.virtualbox.org/virtualbox/debian lenny contrib non-free


# deb http://archive.getdeb.net/ubuntu precise-getdeb apps

# deb http://archive.getdeb.net/ubuntu precise-getdeb games



Step 2.  Secure Key 등록 하기

wget으로 Key를 다운 받은 후 apt에 등록 하자.



wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc

sudo apt-key add oracle_vbox.asc



Step 3.  Virtualbox 4.2 설치 하기

아래의 명령어를 실행 하자.



sudo apt-get update
sudo apt-get install virtualbox-4.2

sudo apt-get install dkms



설치가 완료 되었다면 Virtualbox를 실행 하자. 아래와 같은 화면이 나왔다면 성공 이다.



※ 공식 사이트 : https://www.virtualbox.org/wiki/Linux_Downloads



Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Nodejs는 real-time application에 적합하고, event-driven, non-blocking I/O 를 사용한다.


Resolve 1.  real-time application



고객들의 요구 사항이 높아지면서 기술적으로 실시간(real-time) 을 구현해야 한다. 대표적으로 네이트온 웹 메신저, 페이스북 채팅 등이 있다. Nodejs는 real-time application이 필요로 할 때 대응이 빠르다. Socket.io module를 이용하면 간단하게 구현이 가능 하다. non-blocking I/O 이기 때문이다. Java 기반으로 구현을 해야할경우 Comet, Dwr 등을 이용해야 하는데 많은 시간이 요구 되고 난이도가 있는 편이다. 


Resolve 2.  event-driven



실행 절차

a:  Client는 Server로 요청 한다. - event 발생

b:  Server는 Client로 응답 한다. - callback


구조


server.on(event, callback);



사용 예.


server.on('request', function(request, response){

        res.writeHead(200, { 'Content-Type' : 'text/plain' });

        res.write('Hello World');

        res.end();

});



결론

Nodejs는 요청이 들어올때마다 Thread를 생성 하는 서버와는 다르게 단일 Thread이고 요청이 들어올때 마다 Event를 발생 시키고 요구 조건이 다 처리가 되면 Callback으로 응답을 한다. 이와 같은 방식은 메모리를 효율적으로 사용 하고, 많은 동시 접속자를 수용 할 수 있다.


Resolve 3.  non-blocking I/O



Nodejs는 요청이 들어올때마다 Event를 발생시킨다. blocking 방식과는 다르게 계속 추가적인 Event를 수용할 수 있다.


'Nodejs' 카테고리의 다른 글

Nodejs Query IN 절 이용 하기  (0) 2013.02.18
Debian Linux에서 Eclipse, Nodejs 연동하기  (0) 2013.02.16
Nodejs 설치 하기  (0) 2013.02.10
Html을 Jade로 변환하기  (0) 2013.02.06
Nodejs의 의미와 자바의 대안  (0) 2013.02.05


Ubuntu 12.04 LTS, Mint 13 Maya Version에서 정상 동작 했다.


Step 1.  설치 파일 다운 받기

32bit - i386, 64bit - amd64 



wget http://kldp.net/frs/download.php/5998/nateon_1.2.0-327-oneiric1_i386.deb

wget http://kldp.net/frs/download.php/5999/nateon_1.2.0-327-oneiric1_amd64.deb



Step 2.  Repository 설정 하기



sudo add-apt-repository ppa:kyu419/nateon-ppa 



Step 3.  deb file 설치 하기

설치 -i, 삭제 -r 옵션을 적용 한다.



sudo dpkg -i nateon_1.2.0-327-oneiric1_amd64.deb



의존성 오류가 발생 한다면 아래 명령어를 실행 하고 다시 설치 해보자.


sudo apt-get install -f 



Step 4. 실행 하기

nateon 이라고 명령어를 준다. 아래와 같은 화면이 나오면 성공 이다.



※ 공식 사이트: http://nateonweb.nate.com/download/messenger/linux/




Step 1.  Nodejs 설치 하기

Ubuntu에서 설치 하는 방법이다. 아래의 명령어를 실행 하자.



sudo apt-get install python-software-properties python g++ make

sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get update

sudo apt-get install nodejs npm



Version 차이가 있을 수 있으므로 저장소를 변경 한후 설치 한다.


버전 확인 하기


whitelife@whitelife ~/Desktop $ apt version nodejs

0.8.19-1chl1~precise1



원문은 Wiki를 참고 하면 된다. https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager


Step 2.  plugin 설치 하기

connect module의 확장 형태로 만들어진 express framework, js 파일이 수정 되면 자동으로 컴파일 해주는 nodemon 자주 사용 되기 때문에 -g 옵션을 주어 Global로 설치 한다. 추가로 사용 하는 plugin이 있다면 설치 하자.



sudo npm install -g express

sudo npm install -g nodemon



'Nodejs' 카테고리의 다른 글

Debian Linux에서 Eclipse, Nodejs 연동하기  (0) 2013.02.16
Nodejs is that ?  (0) 2013.02.10
Html을 Jade로 변환하기  (0) 2013.02.06
Nodejs의 의미와 자바의 대안  (0) 2013.02.05
nodemon 사용하기  (0) 2013.02.04


mint는 설치가 완료 된 후, 한글 설정이 되어 있지 않다. 직접 설치를 해야 한다.


Init.  Package Manager Repositories 설정 하기

Menu > Package Manager > Settings > Repositories



Other... 를 선택하여 직접 선택 한다.



한국 서버로 설정 하면 다운로드 속도가 좀 더 빠르다.


Step 1.  Update 하기

아래의 명령어를 실행 하자. 



whitelife@whitelife ~/Desktop $ sudo apt-get update

[sudo] password for whitelife: 


// ...



Step 2.  hangul package 설치 하기

아래의 명령어를 실행 하자. 



whitelife@whitelife ~/Desktop $ sudo apt-get install ibus-hangul

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following extra packages will be installed:

  ibus ibus-gtk ibus-gtk3 libhangul-data libhangul1 libibus-1.0-0 python-ibus

The following NEW packages will be installed:

  ibus ibus-gtk ibus-gtk3 ibus-hangul libhangul-data libhangul1 libibus-1.0-0

  python-ibus

0 upgraded, 8 newly installed, 0 to remove and 521 not upgraded.

Need to get 2845 kB of archives.

After this operation, 8662 kB of additional disk space will be used.

Do you want to continue [Y/n]?  Y


// ...


Setting up ibus-gtk (1.4.1-3ubuntu1) ...

Setting up ibus-gtk3 (1.4.1-3ubuntu1) ...

Setting up libhangul-data (0.1.0-1) ...

Setting up libhangul1 (0.1.0-1) ...

Setting up ibus-hangul (1.3.1-3build1) ...

Processing triggers for libc-bin ...

ldconfig deferred processing now taking place



Step 3.  Language Support 설정 하기

Control Center > Language Support 에 들어가면 아래와 같은 창이 나온다 설치 하자.



설치가 완료 되면 Close를 한 후 다시 창을 열자.

Language, Regional Formats 에서 Apply System-Wide 를 클릭 하자.



완료 되었다면, Reboot 한다.

한글이 적용 되었다. !!!



Grub 화면도 한글로 적용하려면 grub-pc package를 재설치 해야 한다.



sudo apt-get remove grub-pc

sudo apt-get install grub-pc





아래의 페이지에서 Html -> Jade converter 한다. 간편하게 이용이 가능 하다.




'Nodejs' 카테고리의 다른 글

Nodejs is that ?  (0) 2013.02.10
Nodejs 설치 하기  (0) 2013.02.10
Nodejs의 의미와 자바의 대안  (0) 2013.02.05
nodemon 사용하기  (0) 2013.02.04
[스크랩] 완벽 튜토리얼 정리  (0) 2013.02.04


보다가 내용이 유익해서 올림.


※ 참고 사이트: http://www.slideshare.net/JieunLee5/3-nodejs


'Nodejs' 카테고리의 다른 글

Nodejs 설치 하기  (0) 2013.02.10
Html을 Jade로 변환하기  (0) 2013.02.06
nodemon 사용하기  (0) 2013.02.04
[스크랩] 완벽 튜토리얼 정리  (0) 2013.02.04
Nodejs로 WebServer 띄우기  (0) 2012.11.18

+ Recent posts