nginx install - osx leopard

좋다는 메일이 떠돌아서 한번 설치해봤다. 간단하게;;;

#. nginx install - osx macport

sudo port install nginx
...
which nginx
/opt/local/sbin/nginx

daemon 등록 > 필요한 경우
sudo launchctl load -w /Library/LaunchDaemons/org.macports.nginx.plist
 
nginx -s [ stop | quit | reopen | reload ]

nginx (x) -> sudo nginx (o)

[emerg]: open() "/opt/local/etc/nginx/nginx.conf" failed (2: No such file or directory)

nginx.conf, mime.types 를 만들어준다. 뜨는거 보기 위해 일단 카피!

sudo cp /opt/local/etc/nginx/nginx.conf.sample /opt/local/etc/nginx/nginx.conf
sudo cp /opt/local/etc/nginx/mime.types.sample /opt/local/etc/nginx/mime.types

sudo nginx

홈페이지[1]도 그렇지만 welcome 페이지 또한 참 허접하다...그렇지만...

#. tomcat proxy
헐, 이것도 정말 간단하다.
/opt/local/etc/nginx/nginx.conf
        #location / {
        #    root   share/nginx/html;
        #    index  index.html index.htm;
        #}

        location / {
            proxy_pass    http://localhost:8080/;
            index index.jsp;
        }

tomcat 띄우고 proxy host주소를 넣어주면 된다.

이후부터는 tomcat의 context를 따른다.
http://localhost/test는 실제 http://localhost:8080/test 이다.

[1] http://www.nginx.net/
[2] http://wiki.nginx.org/NginxInstall

댓글

이 블로그의 인기 게시물

Protopage.com

Android, MediaPlayer IllegalStateException 상황