아파치 rewrite 로 proxy 흉내 낼려고 하는데...

gitagy의 이미지

안녕하세요?

제목의 proxy란 용어가 적절히 사용됩는지는 잘 모르겠습니다.

아파치2.0를 가장 가볍게 WORKER MPM으로 컴파일 하여 80 포트에 올렸습니다.

그리고 기존에 돌아가던 아파치1.3 (PHP+ORACLE 연동)을 8080포트에 올렸습니다.

이상태에서 static 한 파일들은 80포트에서 그대로 빠르게 처리하고

dynamic 한 파일들은 모드 8080 포트에게로 제어권을 넘겨 버리고 싶습니다.

아파치 rewrite 를 이용하여 위와 같은 처리가 가능 한지 알고 싶습니다.

이래저래 찾아봐도 도통 될것같지가 않지만 안될 이유도 없을것 같기에 질문 드립니다.

그리고 위와 같이 static 부분과 dynamic 을 그분하여 동작했을때 이점이 있을까요?

저렇게 구성하고나니 앞단에 squid 같은 진짜 proxy가 있어도 될것 같고 하나로 처리 하대 fast-cgi 같은걸 활용해도 될것 같고 초보에게 멋진 조언좀 해주세요.

mushim의 이미지

rewrite 모듈은 아파치내부에서 다루는 url 값을 바꿀 때 사용하는 것이므로, 요번 경우와는 상과없습니다.

squid 같은 프락시를 사용하셔야 합니다.

linux 라면, kernel 내에서 동작하는 tux 를 써보심도 괜찮을것 같군요.

ai의 이미지

실제로 구성해 본 경험은 없습니다만 mod_rewrite 로 가능해 보입니다. 이를테면 8200 포트로 apache-mod_perl 을 하나 더 띄워두고

    RewriteRule ^(.*\/perl\/.*)$  http://%{HTTP_HOST}:8200$1 [P]
    RewriteRule ^(.*\/cgi-perl\/.*)$  http://%{HTTP_HOST}:8200$1 [P]

특정한 파일의 요청에 대해 로컬의 8200 포트에 떠 있는 apache 가 응답하도록 설정해 보세요.

War doesnt determine whos right, just whos left.

mushim의 이미지

mod_rewirt 가

external request redirection
internal proxy throughput

도 가능하군요.

물론 mod_proxy 가 compile 되어 있어야 겠죠.

ai 님 저의 무지를 깨우쳐주셔서 감사합니다. ^^

ai의 이미지

mushim wrote:
mod_rewirt 가

external request redirection
internal proxy throughput

도 가능하군요.

물론 mod_proxy 가 compile 되어 있어야 겠죠.

ai 님 저의 무지를 깨우쳐주셔서 감사합니다. ^^


직접 테스트하지도 않은 내용을 올리고서 이런 말씀을 듣게되니 민망합니다. 안되면 어떻하지요.? :) 동적 페이지를 분리해 처리하는 것이 어느 정도의 효율을 더 낼 수 있는지 궁금하기도 한데.. op 께서 직접 결과를 올려주시길 기대해 봅니다. 그리고 아마도 이런 구성을 해 보신 분들도 계실테니, 저도 이 기회를 빌어 조언을 부탁드리고 싶네요.

War doesnt determine whos right, just whos left.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.