Ubuntu(우분투)에 NGINX 설치
1. 가장 최신 버전의 NGINX를 설치하기 위해 source.list에 Repository를 추가
| sudo gedit /etc/apt/sources.list | 
2. gedit 창에서 가장 하단에 아래와 같이 추가 후 저장
| 
   deb http://nginx.org/packages/ubuntu/ lucid nginx 
  deb-src http://nginx.org/packages/ubuntu/ lucid nginx  | 
3. nginx 최신버전을 다운로드 하기 위해 추가
|   nginx=stable # use nginx=development for latest development version add-apt-repository ppa:nginx/$nginx  | 
4. 추가된 Repository를 업데이트
| sudo apt-get update | 
update 도중, "W: GPG 오류: http://nginx.org lucid Release: 다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다 : NO_PUBKEY ABF5BD827BD9BF62" 와 같은 오류가 발생하였을 경우, 아래와 같이 하면 됩니다.
| gpg --keyserver keyserver.ubuntu.com --recv-key ABF5BD827BD9BF62gpg -a --export ABF5BD827BD9BF62 | apt-key add - | 
gpg key를 export시
|   gpg: WARNING: nothing exported gpg: no valid OpenPGP data found.  | 
와 같은 오류가 날 경우, 아래와 같이 generation key를 생성해 준다.
| gpg --gen-key | 
Key Generation 도중 다음과 같은 오류 발생시, "
We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
"
|   sudo apt-get install rng-tools vi /etc/default/rng-tools 에 아래의 내용을 추가 HRNGDEVICE=/dev/urandom  | 
5. NGINX 설치
| sudo apt-get install nginx | 
6. NGINX 구동 방법
|   sudo /etc/init.d/nginx start    (시작) sudo /etc/init.d/nginx stop (정지) sudo /etc/init.d/nginx restart (재시작)  | 
구동시 아래와 같이 오류가 발생시,
|   * Starting nginx nginx                                                          nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind()  | 
아래와 같이 /etc/nginx/sites-available/default 파일 수정
| #listen [::]:80 default_server; | 
7. http://localhost 접속하여 설치 확인
'리눅스' 카테고리의 다른 글
| 우분투 12.04 한글 깨지는 것 처리하기 (0) | 2013.11.19 | 
|---|---|
| Apache 설정시 에러 (0) | 2013.06.13 | 
| Ubuntu(우분투)에 Tomcat6 설치하기 (0) | 2013.01.01 | 
| Ubuntu(우분투)에 JDK 1.7 설치하기 (0) | 2013.01.01 | 
| VirtualBox에 Ubuntu 12.04 (우분투) 설치하기 (0) | 2013.01.01 |