보통 리눅스에 설치 했을 경우 경로는 /etc/nginx/ 이다.

 

Step 1.  Vitrual Host Configs 경로 설정하기

 

// ... 

 

##  
# Virtual Host Configs
## 

include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;

 

// ...

 

Step 2.  Vitrual Host Configs 설정하기

default 설정은 /etc/nginx/site-enabled/default 를 참고 한다.

 

server {

// ...

}

 

위와 같은 형태 이다. 아래 자주 쓰는 설정을 소개 한다.

 

 분류

설명 

root

 

  root /usr/share/nginx/www;

  image, javascript, html의 실제 경로

 

index

 

  index index.html index.htm;

  requestUri가 / 로 왔을 경우 요청 되는 페이지

 

server_name

 

  server_name localhost;

  server domain 명

 

location

 

  location / {

    proxy_pass  http://127.0.0.1:8080;

  }

  requestUri 에 따른 설정 접근 제한, was 로 요청 위임등 이 가능하다.

  - proxy_pass: 요청을 받아서 해당 주소로 요청을 위임 한다.

 

rewrite 

  

  rewrite ^/(.*)  http://www.test.co.kr/$1

  특정 요청이 왔을 경우 패턴에 의해서 재요청 한다.

 

 

Step 3.  Sample

rewrite는 사용 용도에 따라 location 안에 같이 사용이 가능하다.

 

server {

  root /usr/share/nginx/www;

  index index.html index.htm;

 

  server_name localhost;

 

  location /test {

    rewrite ^/(.*)  http://www.test.co.kr/$1

  }

 

  location / {

    proxy_pass  http://127.0.0.1:8080;

  } 

}

 

설정이 JSON 형태라 Apache 에 비해 간단 하고 명확한거 같다.

 

※ 참고 사이트: http://nginx.org/en/docs/

 

'Server,Was' 카테고리의 다른 글

Nginx 403 (13: Permission denied) 현상 해결하기  (0) 2013.04.26
Openssl 사설 인증서 만들기  (0) 2013.04.24
Nginx Ubuntu에서 설치하기  (0) 2013.04.23
Nginx OSX에서 설치하기  (0) 2013.04.23
war 파일 생성 하기  (0) 2013.02.17


우분투로 스크린샷 찍는 방법


보조 프로그램에 보면 스크린샷 이 있다.



스크린샷 찍기를 하면 아래와 같은 그림을 볼 수 있다.



저장을 하고 사용을 하면 된다. 



nginx를 설치합시다.~


Step 1.  nginx 설치 하기



whitelife@ubuntu:~$ sudo apt-get install nginx

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following extra packages will be installed:

  nginx-common nginx-full

The following NEW packages will be installed:

  nginx nginx-common nginx-full

0 upgraded, 3 newly installed, 0 to remove and 337 not upgraded.

Need to get 407 kB of archives.

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

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



Step 2.  nginx 시작하기



whitelife@ubuntu:~$ sudo service nginx start

Starting nginx: nginx.

whitelife@ubuntu:~$ 



화면을 확인 하자.


성공이다.~



'Server,Was' 카테고리의 다른 글

Openssl 사설 인증서 만들기  (0) 2013.04.24
Nginx 기본 설정하기  (0) 2013.04.24
Nginx OSX에서 설치하기  (0) 2013.04.23
war 파일 생성 하기  (0) 2013.02.17
Tomcat7 Web Application Deploy 하기  (0) 2013.02.01


우분투를 설치하면 기본테마가 참 불편하다....

그놈을 설치 하자~



sudo add-apt-repository ppa:gnome3-team/gnome3

sudo apt-get update

sudo apt-get install gnome-shell



설치를 한 후 로그아웃을 한다.

GNOME 클릭 하기

로그인을 하자.

적용 된 모습을 볼 수 있다.

※ 출저 사이트: http://www.filiwiese.com/installing-gnome-on-ubuntu-12-04-precise-pangolin/



nginx를 설치합시다.~


Step 1.  PCRE (Perl Compatible Regular Expressions) 설치하기

Perl 호환 정규식 이라고 한다. 먼지는 잘 모르겠지만... 설치해야 한다. 



curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.gz

tar zxvf pcre-8.21.tar.gz

./configure --prefix=/usr/local

make

sudo make install



Step 2.  nginx 설치하기

osx에는 svn 이 내장 되어 있다. 



svn checkout svn://svn.nginx.org/nginx/tags/release-1.3.16

./auto/configure
make
sudo make install



Step 3.  nginx 시작하기

command 에 대한 도움말을 볼 수 있다.



sudo /usr/local/nginx/sbin/nginx -?

nginx version: nginx/1.3.16

Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]


Options:

  -?,-h         : this help

  -v            : show version and exit

  -V            : show version and configure options then exit

  -t            : test configuration and exit

  -q            : suppress non-error messages during configuration testing

  -s signal     : send signal to a master process: stop, quit, reopen, reload

  -p prefix     : set prefix path (default: /usr/local/nginx/)

  -c filename   : set configuration file (default: conf/nginx.conf)

  -g directives : set global directives out of configuration file



서버를 시작해 보자.



sudo /usr/local/nginx/sbin/nginx



확인하기.

성공이다~


※ 참고 사이트

pcre - http://www.pcre.org/

nginx - http://nginx.org/en/download.html


'Server,Was' 카테고리의 다른 글

Nginx 기본 설정하기  (0) 2013.04.24
Nginx Ubuntu에서 설치하기  (0) 2013.04.23
war 파일 생성 하기  (0) 2013.02.17
Tomcat7 Web Application Deploy 하기  (0) 2013.02.01
Apache Friends XAMPP 설치 하기  (0) 2013.01.30


개발 도중 문제점이 발견 됬었다.


문제점

  -  유일하게 IE7 에서는 CSS 속성을 작성하지 않는 것에 대해서 default 값을 적용해 버린다.


해결방법

  -  CSS 속성을 줄 때 하나하나 명시하자.

 

IE7 도 제외가 됬으면....



코드 작성 후 설명 할 때 유용한 plugin 이다.


Package Control 은 설치되어 있다고 가정 합니다.


Step 1.  Package 설치하기

  • windows: ctrl + shirt + p
  • linux: ctrl + shirt + p
  • osx: command + shift + p 
command 창이 나오면 Package Control: Install Package 를 선택 한 후 docblockr 작성 enter 하면 설치가 된다.

Step 2.  확인하기

/** 입력 후 enter 치기



위와 같은 형태로 가이드를 잡아 준다.



개발 중 url 테스트가 필요할 경우 유용하게 사용되는 plugin 이다. 설치해보자.


Package Control 은 설치되어 있다고 가정 합니다.


Step 1.  Package 설치하기

  • windows: ctrl + shirt + p
  • linux: ctrl + shirt + p
  • osx: command + shift + p 
command 창이 나오면 Package Control: Install Package 를 선택 한 후 http requester 작성 enter 하면 설치가 된다.

Step 2.  확인하기

http://www.naver.com 작성 후 블록 하고 option + command + r 을 클릭 한다.



아래와 같이 응답이 올 것이다.

+ Recent posts