아파치 서버 httpd.conf설정 질문입니다.

dvvbstation의 이미지

아파치 서버를 셋팅하면서 환경설정 파일을 보다 궁금한 점이 있습니다.
책을 곰곰히 들여다 보아도 이해가 잘 안가는 부분이 있네요.
디렉터리 셋팅에 관한 것인데
"Directory지시자는 해당 디렉터리 이하의 모든 웹문서를 어떻게 제어할 것인가를 설정한다"
이렇게 나와있더군요.

(Directory /)
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
(/Directory)

(Directory "/usr/local/server/apache/cgi-bin")
AllowOverride None
Options None
Order allow,deny
Allow from all
(/Directory)

위 디렉터리 섹션에서 Option은 디렉터리의 특성을 결정한다고 하구요.
AllowOverride는 인증에 관한 부분이라 합니다.
Order deny,allow 이렇게 되있으면 차단이고
Order allow,deny로 되어있으면 허용이라 하는데 도통 뭘 차단하고 허용하는지를 모르겠는 겁니다.
디렉터리 섹션이 여러개 있길래 봐봤는데
Order deny,allow라인 다음에는 항상 Deny from all
Order allow, deny라인 다음에는 항상 Allow from all
이 들어가길래 아! 이거 Deny from all는 차단일 때 붙고 Allow from all은 허용일 때 무조건 붙는거구나 생각하다가
좀 더 내려가니 File Match 섹션이 있군요.

(FilesMatch "^\.ht")
Order allow,deny <- 허용
Deny from all <-차단
Satisfy All <-이건 또 허용일 때 유효한 옵션이랍니다.
(/FilesMatch)
저의 어설픈 논리가 깨지니 이번엔
Order이 목록을 출력할 것인가에 관한 허용/차단 여부를 가름하게 하고
다음라인의 Deny from all이나 Allow from all은 퍼미션에 관한 부분이구나 생각했습니다.
근데 아닌 것 같군요.
이 부분에 대해 명쾌하게 해설해 주실분이 계신지요...

Satisfy all 은 Allow from에 해당하는 경우만 허용하는데 Allow from이 지정되지 않았으므로 모두 Deny가 된다. 위의 설정은 확장자 ht를 가지는 모든 파일은 인정하지 않고 무시해 버린다.
이렇게 설명이 나와있는데 Allow from에 해당하지 않는데 Satisfy all옵션은 왜 갖다 붙여놓은 것인지...
궁금합니다.

bushi의 이미지

AllowOverride 는 해당 디렉토리의 .htaccess 파일에서 지정가능한 옵션을 제한할 때 사용합니다.

AllowOverride None

라 써주면 해당 디렉토리 이하의 .htaccess 파일에서 어떤 옵션도 추가하거나 바꾸지 못합니다.
(계정 사용자들이 엄한 짓을 하지 못하도록 막아야 되는 상황을 상상해 보세요.)

Order 는 접근 검사 규칙의 적용순서를 정해줄 때 사용합니다.

Order allow,deny

라 써주면 allow 규칙을 먼저 적용하고, 이것을 통과한 놈들에 대해 다시 deny 규칙을 적용시키라는 뜻입니다.

FilesMatch "^\.ht"

는 .htaccess 처럼 추가옵션 파일이나 .htpasswd 같은 인증에 사용되는 파일들 자체를 보호하기 위한 설정들입니다.

대체 어떤 책을 보시길래...
차라리 apache 홈페이지의 문서들을 보시는게 좋겠습니다. 한글로 설명되어 있습니다.
http://httpd.apache.org/docs/2.2/
http://httpd.apache.org/docs/2.0/

OTL

dvvbstation의 이미지

아파치에 있는 링크 문서도 보았구요.
그동안 디렉터리섹션에 대해 어느정도 이해했다고 생각했습니다.
자만이었는지... 이해를 못한 것 같군요.
Satisfy항목이 애매합니다. Satisfy All과 Any가 있더군요.
아래와 같이 코딩을 할 경우 자신은 인증 없이 important디렉터리에 접속을 하고 타인은 인증을 통해
접근이 가능하다 합니다.

AuthType Basic AuthName "auth test..." AuthUserFile /usr/local/server/apache/bin/password Require user authtest1 -----------------------여기까지는 authteset1계정으로 인증가능 Satisfy Any <--- 이것이 키포인트 인거 같은데 Satisfy All을 주면 자신을 제외한 접근 불가 Order deny,allow Deny from all ---------웹페이지 접근 차단 Allow from 127.0.0.1 ---------자신만 허용함

Satisfy All은 디렉터리 섹션에 있는 모든 라인을 만족시킬 경우 접근을 허용하는 것 같은데...
Satisfy Any의 역할을 모르겠네요.
이 옵션을 통해 어떻게 인증이 없이 엑세스가 가능하게 되는지...
Satisfy가 인증 절차를 생략하게도 할 수 있나요?

잘모르지만의 이미지

Order allow,deny면
deny 부터하고 allow적용으로 알고있었는데..
저도 지나가다 몰라서 여쭤봅니다

jspaik의 이미지

5.6.5. Order
order ordering
Directory, .htaccess
The ordering argument is one word (i.e., it is not allowed to contain a space) and controls the order in which the foregoing directives are applied. If two order directives apply to the same host, the last one to be evaluated prevails:

deny,allow
The deny directives are evaluated before the allow directives.

allow,deny
The allow directives are evaluated before the denys.

출처: https://docstore.mik.ua/orelly/linux/apache/ch05_06.htm

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.