윈도우 정품인증 통과하기

먼저 퍼온 글임을 밝힙니다.

저희 회사는 MS License 중 OV 전사계약 이라는 것을 통해 적법하게 윈도우를 사용하고 있지만, 종종 임의로 자기가 윈도우를 깔아놓고 업데이트가 안된다고 요청하는 직원들이 있어 유사시에 참고하려고 올려둡니다.

여러가지 정품인증 방법을 써보았지만 이방법이 가장 확실했습니다.



Microsoft Windows XP Service Pack 3 - WGA Patch





# Concept

  가이드는 윈도우XP SP2환경에서 인터넷탐색기 및 미디어 플레이어의 업그레이드시에
 정품인증(WGA) 과정을 거쳐서 정품이 아니라고, 설치를 거부하는 경우를 대비해서
 모든 윈도우버전(VLK / RTM / Retail / MSDN)에서 WGA패치를 수행하는 방법을 설명한다.



 # Step of WGA Patch
  
   * WGA패치 다운로드
    * 압축해제
    * Findkey.exe 실행
    * wga-fix.exe 실행
    * MGADiag.exe 실행

# Requirement
 
  본 가이드에서 설명하는 것은 다음을 전제로 한다.
  윈도우XP - SP2환경을 이미 설치했다는 것을 전제로 하며, 최초 설치 후
  윈도우 업데이트를 수행해서, 윈도우정품인증 업데이트를 적용한 후에 본 패치를
  사용하여야 정상적으로 작동하게 된다.
  Internet Explorer 7 / Windows Media Player 11버전과 같은 MS의 업그레이드 업데이트
  설치시 WGA(정품인증)과정을 승인하도록 해주며, 어떠한 윈도우XP버전이라도 상관없다.


# Step Of WGA Patch

   * WGA패치 다운로드
     먼저 WGA패치에 사용할 파일을 아래의 경로에서 다운로드 해서 , 임의의 폴더에 저장한다.

  XP_Genuine.zip
 
  * 압축해제
   상기에서 다운로드 받은 파일을 임의의 폴더에 압축을 해제한다. (예, C:\Temp)
   압축파일내부에는 7개의 파일이 있으며, 실행 순서를 파일이름 앞에 추가해 두었으므로,
   순서대로 실행하기 바란다. 압축을 해제한 폴더의 상태는 아래의 화면과 같다.

사용자 삽입 이미지


  


   * Findkey.exe 실행
     "2findkey.exe"프로그램을 실행 한 후 "Options" -> "Change Windows Key" 메뉴를 선택한다.
    본 작업은 설치시 사용했던 시디키 대신에 상기에서 작업했던 시디키로 변경하는 작업을 수행한다.
  
사용자 삽입 이미지

   본인이 보유하고 있는 정품 시디키를 순서대로 입력해 준 후,
    "Change"버튼을 눌러서 시디키를 변경 시켜준다.
사용자 삽입 이미지

    "Change"버튼을 눌러서 실행 하며, 아래의 화면과 같이 정상적으로 변경했다는 메세지박스가 표시된다.
사용자 삽입 이미지
    2findkey.exe프로그램은 이제 종료해도 되고, 그냥 실행해 두어도 된다.



   * wga-fix.exe 실행
    "3wga-fix.exe"프로그램을 실행 한 후 "예(Y)"버튼을 눌러서 실행한다.
사용자 삽입 이미지

     아무런 메세지나 증상도 없으니, 기다리지 말기 바란다. 이제는 WGA패치가 완료되었다.
    확인하는 것만 남았다.


   * MGADiag.exe 실행
     "4MGADiag.exe"프로그램을 실행해서 실제로 제대로 변경이 되었고, WGA패치가 되었는지를
     확인하는 프로그램이다. 프로그램을 실행한 후 우측 하단의 "Continue"버튼을 눌러서 진행한다.
사용자 삽입 이미지

    약간의 시간이 경과하고(1-2초) 아래의 화면과 같이 "Genuine"라는 글자가 나타나면 정상적으로
    WGA패치가 적용된 것이다.

사용자 삽입 이미지
 
   이제는 시스템을 리부팅 한 후 윈도우 업데이트 사이트에서 마음대로 업데이트를 해도 정품으로
   인식해서 설치를 거부하는 일은 없을 것이다.



# Have a Problem?
 
  만약에 상기의 화면과 같이 "Genuine"이라는 글자가 나오지 않는다면, 이미 다른 WGA패치를 수행했다는 의미이다. 이것은 어떠한 WGA패치를 수행한 지에 따라 삭제법이 다르므로, 본인은 설명할 수 없다. 새롭게 윈도우를 설치하고, 본 가이드대로 수행하기 바란다. 설치순서는 다음과 같다.

  윈도우 설치 => 윈도우 업데이트 수행 (1회) => WGA패치 수행 => 윈도우 업데이트


# PostScript

   본 WGA 패치 방법은 다른 여러가지 방법보다 가장 확실한 방법중 하나이다. 기존의 설치시에 입력했던 시디키는 MS사에서 이미 막아버렸다.(Black Listing) 정품 씨디키를 이미 보유하고 있는 사람만이 사용할 수 있는 방법이다.

# Additional
  Microsoft WindowsXP Intergrated Services Pack 3 Volume Edition에서도  정상적으로 인증됩니다.

by 아고라 | 2009/09/08 20:30 | 컴퓨터 | 트랙백 | 덧글(14)

Bitnami 를 통한 Win32 Redmine 0.8.4 설치 삽질기

EnTheos 님의 블로그를 참조하면서 버전 바뀐 부분때문에 에러가 났던 부분을 참조해 설치 삽질기를 다시 써보려 한다.

EnTheos 님의 블로그에 보면 한글 문제 해결에 대한 포스트가 두개가 있다. 각각 중복된 내용과 약간씩 다른 내용이 있고, 또한 설치과정중에 본인이 겪은 다른 문제까지 합쳐서 한글문제 clear 를 이룬 포스팅을 하고자 한다.


RedMine 의 설치는 이미 되었다고 가정한다. 여기서는 패키지 설치 이후 한글문제를 해결하는 과정만 다룬다.

일단 모든 작업은 Dos 프롬프트를 띄워서 해야 한다.

"아래 작업은 도스창(Command창) 을 열어서 해야하는데 Path 문제로 타이핑이 길어지는 번거로움이 있습니다.
C:\Program Files\BitNami Redmine Stack\scripts\setenv.bat를 먼저 실행시키고 하거나 관련 Path를 환경설정 ( 시스템 등록정보 -> 고급 -> 환경변수 중 Path )에 넣어주시면 편합니다."

이말이 무슨 말인지 한참 후에 알게 되었다. 이걸 안해주면 rake 할때 문제가 심각해진다. 일단 도스창을 열고

1. C:\Program Files\BitNami Redmine Stack\scripts\setenv.bat

이걸 먼저 실행하자. 그리고 이 도스창은 닫으면 안된다. 본인은 이걸 닫아버려서 여러번 삽질함.


2.  \BitNami Redmine Stack\mysql\my.ini를 열어서 아래 내용을 추가/수정 한다. (굵은 글씨체는 EnTheos 님 포스팅에 없거나 바뀐 부분)

[client]
default-character-set=utf8

[mysqld]
character-set-client-handshake = FALSE
init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci

[mysql]
default-character-set=utf8

3. MySQL 서비스를 다시 시작하고 ( 실행 창에서 services.msc 치고 redmineMySQL을  중지/시작 ) 콘솔로 로그인해서 서버 설정 상태를 확인한다.



c:\program files\BitNami Redmine Stack\mysql\bin\mysql -uroot -p
Enter password: ***********

mysql> show variables like 'c%';
+--------------------------+--------------------------------------------+
| Variable_name            | Value                                      |
+--------------------------+--------------------------------------------+
| character_set_client     | utf8                                       |
| character_set_connection | utf8                                       |
| character_set_database   | utf8                                       |
| character_set_filesystem | binary                                     |
| character_set_results    | utf8                                       |
| character_set_server     | utf8                                       |
| character_set_system     | utf8                                       |
| character_sets_dir       | E:\PROGRA~1\BITNAM~1\mysql\share\charsets\ |
| collation_connection     | utf8_general_ci                            |
| collation_database       | utf8_general_ci                            |
| collation_server         | utf8_general_ci                            |
| completion_type          | 0                                          |
| concurrent_insert        | 1                                          |
| connect_timeout          | 10                                         |
+--------------------------+--------------------------------------------+


mysql> status
--------------
mysql  Ver 14.12 Distrib 5.0.67, for Win32 (ia32)

Connection id:          2
Current database:       bitnami_redmine
Current user:           root@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.0.67-community-log MySQL Community Edition (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
TCP port:               3306
Uptime:                 1 hour 12 min 18 sec

Threads: 3  Questions: 1471  Slow queries: 0  Opens: 359  Flush tables: 1  Open
tables: 0  Queries per second avg: 0.339
--------------

위와 같이 나오면 설정이 잘 된것이다.


4. DB 를 삭제하고 다시 만든다. 최신 버전은 DB 이름이 바뀌었다.

mysql> drop database bitnami_redmine;

mysql> CREATE DATABASE bitnami_redmine DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


5. database.yml 수정. 이 또한 경로가 바뀌었다. - \Program Files\BitNami Redmine Stack\apps\redmine\config 에 있음

production:
  adapter: mysql
  database: redmine_production
  host: localhost
  username: bitnami
  password: bitnami
  port: 3306
  encoding: utf8

6. EnTheos 님의 블로그에 있는대로 최신버전의 RedMine 을 SVN 으로 받아서 설치하면 다른 설정을 아무리 만져도 에러가 난다. 따라서 나는 기존의 Redmine 을 그대로 재설치했다.

7. \Program Files\BitNami Redmine Stack\apps\redmine>rake db:migrate RAILS_ENV="production"
 
을 실행하여 를 실행하여 DB Migration 실행한다. 만약 아래와 같은 에러메시지가 나온다면

    7-1. \Program Files\BitNami Redmine Stack\apps\redmine\gem install -v=2.2.2 rails
위와같이 실행하여 rails 를 업그레이드 한다. redmine 0.8.4 에서는 rails 2.2.2 버전이 필요하며, bitnami 버전이 다를 경우 에러메시지에서 요구하는 버전으로 인스톨 하면 된다. 요구하는 버전과 동일한 버전을 인스톨 하여야 함.

8. \Program Files\BitNami Redmine Stack\apps\redmine\rake redmine:load_default_data RAILS_ENV="production"
실행하여 기본 데이터를 넣어준다.

9. http://localhost 로 접속하여 설치시에 지정한 id/password 를 넣어서 제대로 접속되면 설치 끝

by 아고라 | 2009/08/28 02:26 | 컴퓨터 | 트랙백 | 덧글(2)

이어지는 구내염 이야기..

병원을 다녀왔다.

젠장... 이 망할 구내염이 자가면역질환의 일종인 베체트병일 확률이 있단다. 정밀검사를 해야 한단다 빌어먹을...
우리나라에서 10만명당 15명밖에 없는 희귀난치병이란다. 희귀병은 보통 10만명당 43명 이하면 희귀병으로 친다.

그냥 구내염이 심한줄로만 알았는데 희귀병이라니.. 어이가 땅을 칠 노릇이다.
이 글을 쓰고 있는 지금도 혓바닥 밑에 조그마한놈이 자라나고 있다. 단순 재발성구내염이기를 바라지만... 왠지 불안하다.

포도막염으로 오면 실명의 위험성도 있고 사망위험도 3~4%나 된단다.. 온통 불안한 소식이다.
제발 아니길....

by 아고라 | 2009/08/18 21:37 | 트랙백 | 덧글(1)

x 같던 사장 이야기

내 인생 최고의 선택이자 최악의 선택이었던 회사를 다닌적이 있다.
정확히 딱 1년 버티고 나왔는데, 거기 사장이 아주 가관이었다.

듀퐁 출신이라던데 외국 근무환경을 찬양은 하면서 정작 회사에 적용은 안시키는 이율배반적인 인간이다. 당시 회사는 스웨덴의 장비를 들여다 파는 일을 했는데, 그러다보니 스웨덴회사 직원들하고 업무를 많이 하게 됐다. 다들 알다시피 스웨덴은 '요람에서 무덤까지' 로 유명한 복지가 아주 좋은 국가이다. 물론 국가에서 떼가는 돈도 많지만..
그 스웨덴 회사 직원이 한국에 출장을 자주 왔었는데 7월달쯤이던가 휴가를 간다고 하는 것이었다. 그래서 언제쯤 돌아오는지 물어봤더니 무려 한달! 의 휴가를 간다는 것이다.

주변 직원에게 '아 부럽다 쟤네는 휴가를 한달씩이나 간단다. 스웨덴은 원래 그런갑다. 근데 업무에 빵구 안나나' 라고 얘기하던 중 귀밝은 사장이 어디서 그소리를 듣고 그것도 모르냐는 식으로 '그정도는 쉬어야 제대로 재충전을 하고오지 그정도는 당연한건데 뭘 그걸가지고 그래'라고 그러는 것이다. 하! 그래서 바로 받아쳐 드렸다. '그정도는 괜찮으면 저희도 한달 쉬게 해주세요' 라고 했더니 '그래. 한달 쉬고 푹 쉬어' 라고 바로 그러더라.

그거 말고도 인간성 드러나는 사건이 몇가지 있는데 아후.. 생각하니 또 열받네. 나중에 기회되면 또 쓰겠다.

아, 최고의 선택이 뭐냐고? 그건 그 회사다닐때 소개팅으로 만난 사람이 지금 와이프가 되었다는 거지 ㅋㅋㅋㅋㅋ

by 아고라 | 2009/08/18 21:30 | 사는얘기 | 트랙백 | 덧글(0)

우리 딸이에요~

이쁘죠~~ ㅎㅎ

by 아고라 | 2009/07/01 11:09 | 사는얘기 | 트랙백 | 덧글(1)

편히 가십시오..

by 아고라 | 2009/05/29 14:48 | 사는얘기 | 트랙백 | 덧글(0)

Windows server 2008 'Admin 계정 암호 복잡성 만족 조건'


  
사용자의 계정 이름이나 연속되는 문자 2개를 초과하는 사용자 전체 이름의 일부를 포함하지 않음

처음설치시 암호의복잡성이 활성되어 있으므로 영문,숫자,특수문자포함 6자(포함) 이상으로 설정해야 부팅가능합니다. 설치후 보안옵션에서 암호입력없이 바로 부팅진행 수정가능
다음 네 가지 범주 중 세 가지의 문자를 포함해야 함
영문 대문자(A - Z)
영문 소문자(a - z)
기본 10개 숫자(0 - 9)
알파벳 이외의 문자(예: !, $, #, %)

복잡성 요구 사항은 암호를 변경하거나 만들 때 적용됩니다. 
 
암호예: Ad1234
위에서 처음 영문대문자,소문자,숫자의 조합으로 6글짜 이상이어야 합니다.
기본 자판은 영문대문자인데 Cape Lock 켜져있는 상태는 영문 소문자로 변경됩니다.
 
결론
사용자 암호: 대소문자,숫자의 조합으로 총 6글짜(포함)이상 입력(Cape Lock 켜져있는 상태는 영문 소문자)

암호 재설정 디스크작성을 위한 usb 드라이버 준비: 1.50KB로 userkey이름으로 저장됩니다.
필요없을 경우에는 ,,,,준비할 필요가 없습니다.

 
암호 복잡성 만족 조건 해제 방법_
1. 로컬 그룹 정책 편집기를 엽니다. (제어판-> 관리도구 or Win키+R->gpedit.msc 입력 후 엔터
2. 로컬 컴퓨터 정책 -> 컴퓨터 구성 -> Windows 설정 -> 보안설정 -> 계정 정책 -> 보안 정책
3. 암호는 복잡성을 만족해야 함 -> 해제. (해당 항목 더블클릭 후 사용안함 으로 설정)
 
암호 입력후,,,,,,,,,,,
 

Windows Server 2008 - Granular Password Policies
Windows Server 2008 에서는, 기존에 설정이 불가능했던 OU 단위의 패스워드 정책 적용이 가능해 해졌습니다. 이를테면,. 권한별 계정을 각 OU 단위에 분류한뒤, 해당 OU에 속한 계정에 대해서 패스워드 정책을 다르게 가져갈수 있습니다.

by 아고라 | 2009/05/25 19:24 | 컴퓨터 | 트랙백 | 핑백(1) | 덧글(0)

일반 어플리케이션을 서비스모드로 실행시키는 프로그램

이지서비스

시스템 관리를 하다보면 바쁜(이라고 쓰고 게으른 이라고 읽는다) 프로그래머들이 있다.

서버 부팅시 데몬 형태로 실행되어야 할 어플리케이션임에도 바빠서 서비스형태로 제작하지 못하고 덜렁 EXE 실행파일만 만들어놓고 윈도우 시작프로그램 에다 등록시켜 놓고 쓰라는 식이다.

이런경우에 치명적인 문제점이 로그인을 하지 않으면 그 프로그램이 실행되지 않는다는 것이다. 개인 PC 용의 경우에는 그나마 나은게, 로그인을 하지 않으면 컴퓨터를 사용할 수가 없기에 실행을 어느정도 보장할 수 있다.

그러나 이것도 문제가 되는데, 고의로든 실수로든 해당 프로그램이 종료되면 윈도우의 시작프로그램만 가지고서는 1회 로그인시 단 1회의 실행밖에 되지 않고, 해당 데몬이 죽었더라도 자동 재실행을 한다던지 이런 동작이 불가능 하다. 이런것을 해결해 주는것이 서비스 인데, 서비스로 등록하면 데몬 사망시 3회까지 재실행할 수 있고  1일후에 이 재실행 횟수를 초기화 한다. 즉 하루에 3번씩 데몬이 죽어도 자동으로 재실행하게 만들 수 있다는것이다. 모두 다 윈도우에서 제공하는 기본기능이다. 
 서버의 경우에는 자동으로 reboot 을 하거나 기타 이유로 reboot 후에도 로그인을 하지 않는 경우가 많다. 관리하는 서버가 수백대의 경우에 일일히 로그인을 해야 한다면 그야말로 끔찍한 일일 것이다.

바쁘신 프로그래머가 서비스 형식으로도 안 만들어주는데 프로세스 감시 및 사망시 자동재실행기능 따위를 만들어 줄 리는 없지 않은가. 이 문제를 해결해 주는 프로그램을 열심히 찾다가 어떤 개인분의 블로그에서 보물을 건졌다. 바로 어떤 어플리케이션이든 심지어는 batch 파일까지도 서비스 형태로 실행해주는 프로그램이다. 크기도 작고 사용법도 간단하다. 게다가 영문윈도우를 사용해야 하는 내 상황에서 영문버전까지 제공하니 금상첨화다.

사실 가져다 쓴지는 꽤 오래 됐는데 그동안 사용만 하고 기억을 못하고 있다가 이렇게 원본을 찾아서 링크를 남긴다.

 사실 이런 사항은 서버용 데몬의 성격으로 실행되는 어플리케이션에 대해서는 기본중의 기본지만 이럼에도 불구하고 서비스모드로 만들어지지 않아서 임시로라도 서비스로 꼭 실행시켜야 할 경우 사용하면 아주 유용할 프로그램이다.

by 아고라 | 2009/03/17 20:46 | 컴퓨터 | 트랙백 | 덧글(1)

윈도우에 아파치 설치 2.2.3 httpd.conf 완전분해

아파치2.2.3은 윈도XP에서도 동적공유객체(DSO:Dynamic Shared Object)와 다중처리 모듈(MPM:Multi-Processing Module) 모드로 작동 된다. 아파치 매뉴얼에 나와 있는 것을 근거로 한다면 MPM은 기존의 프로세스 기반(process-based) 서버 보다는 적은 시스템 자원으로 여러개의 요청을 처리한다고 기술되어져 있다. 이 MPM을 제어하기 위해서 중요한 지시어(directive)는 ThreadsPerChild이며, 자식 프로세스(child process)와 최대연결(MaxClients)을 어떻게 설정하느냐 그리고 얼마나 많은 스레드(threads)가 메모리에서 작동하느냐 또는 적절하게 무리없이 처리하느냐에 따라서 웹서버의 서비스 능력(요청에 대응) 및 성능이 결정된다. *** httpd.conf의 파일에 대한 기본적 설정을 파악해 보기. ***

#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "C:/Program Files/Apache2.2" will be interpreted by the
# server as "C:/Program Files/Apache2.2/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
ThreadsPerChild 250
MaxRequestsPerChild 0

# 윈도XP에 보면 작업관리자에 프로세스탭이 있는데 웹사이트에 방문자가 오면 페이지를 보여주기 위해서 해당 프로세스가 떠 있다가 이를 응답하면서 서비스를 해주게 되는데 이렇게 서비스를 하기 위해서 메모리에 떠 있는 프로세스내에는 워커 스레드(worker threads)라는 것들이 실질적인 요청을 받아 처리한다. ThreadsPerChild는 하나의 프로세스당 몇개의 워커 스레드를 일정하게 유지하고 있을 것인가를 결정한다. 윈도우용 아파치2.2.x의 ThreadsPerChild 기본값은 250개이다. 보다 빠른 CPU와 보다 많은 메모리에 따라서 이 개수를 늘려서 보다 많은 웹사이트 방문자를 수용할 수 있으므로, 윈앤위처럼 주메모리가 128Mb라면 매우적은 방문자만을 수용할 밖에 없다. 그렇지 않다면 일반 웹페이지와는 달리 이미지 사용을 최대한 자제해서 페이지를 구성해야 한다. MaxRequestsPerChild는 프로세스 하나가 몇개의 요청을 처리하느냐를 결정하는데 1000이면 1000번의 요청을 처리한 후 소멸되고, 0이면 서비스후에 소멸되지 않고 그 다음 요청을 계속 받아들이게 된다.

# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk. If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "C:/Program Files/Apache2.2"

# 지시어 ServerRoot는 아파치를 운영하고 유지할 때 필요한 여러가지 파일이나 디렉토리들이 유지되는 최상위 위치를 지정한다. 아파치 설치시 사용자정의(custom)로 선택해서 변경했다면 그때 변경된 위치에 따라서 기본값이 다르다. 간단히 말해 아파치가 설치된 경로가 서버루트(ServerRoot)가 된다. 아파치에서 경로를 설정할 때 유의해할 점은 백슬래쉬가 아니고 슬래쉬(/)를 사용한다는 것이다. 그리고 "c:/apache2"나 윈도우의 전통적인 프로그램 설치 경로인 "C:/Program Files/" 하위에 설치되어도 무방하지만 경로가 정확해야 이 디렉터리를 기준으로 아파치관련 부속파일을 경로를 연결해서 사용할 수 있다.

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
 아이피 영역을 지정해서 사용자들을 분산시키는 등 로드밸런싱과 관련사항은 여기서 제외하므로 기본값 listen [포트]와 관련된 사항은 제외하고, Listen은 실질적으로 아파치를 통해서 서비스하는 호스트 컴퓨터의 IP(1대는 생략가능)와 웹서비스 기본 포트 80이 기본값이다. 이 포트를 통해서 웹서버는 요청을 받아 들이게 된다. 그러나 8000또는 8080처럼 포트를 바꾸어 서비스를 할 수 있으며, 이 때 윈도XP의 방화벽을 확인하고 해당 포트를 개방해 주어야 한다. 8000포트 또는 8080포트를 사용할 경우 http://도메인:8000 또는 http://도메인:8080올 서비스를 하게 되지만, 무료로 포트포워딩을 서비스 받아서 직접 http://도메인으로 연결이 가능하다. 포트포워딩은 대부분 일반 사용자들이 가정에 웹서비스를 하지 못하도록 ISP측에서 이를 막아 놓았을 경우 포트포워딩을 이용한다.

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#

각 모듈에 대해서 아래URL을 통해서 기능을 파악할 수 있다.
http://httpd.apache.org/docs/2.2/ko/mod/
http://httpd.apache.org/docs/2.2/mod/

LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so

# 지시어 LoadModule은 아파치 실행시에 필요로하는 기능들을 가진 파일(so)을 불러오는 기능을 수행한다. 예를들어 mod_vhost_alias.so이라는 모듈을 Load해야 virtualhost로 IP재사용이 가능하게 해서 여러개의 사이트를 연결할 수 있는데 이처럼 특정한 기능을 수행하는 모듈이 아파치 실행파일 httpd.exe와 함께 작동하도록 하게해서 필요한 기능은 주석(#)처리를 함으로써 load 또는 unload가 가능한 것이 동적공유객체(DSO)이다. 위에 목록은 아파치 2.2.3 for 윈도우에서의 기본 설정상태이다. 모듈을 Load하는 만큼 메모리를 소모하게 되므로 불필요한 기능은 unload하는 것이 효율적이다. 뿐만 아니라 서드파티(3th-Party) 모듈(so)도 쉽게 load해서 사용할 수 있는 것이 장점이다.

#리눅스에서 아파치2.2.3을 운영하는 경험상 mod_authz_host.so mod_log_config.so mod_setenvif.so mod_mime.so mod_dir.so mod_userdir.so 로 6개정도의 모듈만으로 기본 운영이 된다. 그러나 CGI를 구현하기 위해서는 PHP 모듈, Perl 모듈, 그리고 DOS공격을 대비한 모듈, 프록시 관련 모듈, 웹방화벽 모듈, chroot 모듈, 대역폭 스로틀링 등 여러가지 가지 보조 기능들을 추가해서 운영하게 된다.

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin admin@winnwe.com

# 사이트 관리자의 메일을 설정하는 SeverAdmin 지시어이다. 오류가 발생할 때 나타나게 되므로 관리자가 미처 발견하지 못하는 오류나 또는 장애발생시 친절한 방문자로 부터 연락을 받을 수도 있다.

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName 127.0.0.1:80

# 서버이름 지시어 ServerName은 정식도메인이나 유동IP 포트포워딩을 통한 무료 서브도메인처럼 도메인 이름을 입력하는 것이 보통이지만 영향을 받지는 않는다. DNS에 정식으로 등록되지 않았다면 127.0.0.1이나 호스트 IP를 입력하라고 하는데 localhost 또는 로컬컴퓨터 이름도 무방하다.

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Program Files/Apache2.2/htdocs"

# 지시어 DocumentRoot는 실제 웹사이트를 운영하는 경우의 기본적인 웹사이트의 루트(root)가 된다. 예를들어 웹사이트를 운영하기 위해서 "D:/www/myweb"을 루트로 지정한다. 아파치기 실행되는 로컬 컴퓨터상에서 기본 위치는 DocumentRoot 지시어로 지정을 하고 이 디렉토리에 대한 접근제어(Access Control)는 Directory 지시어로 설정한다. 초보자들이 혼란스러워 하는 경우가 403권한없음 오류인데 자신이 원하는 폴더를 DocumentRoot 지정했으면, 그다음은 Directory 지시어를 통해서 해당 폴더에 대한 접근을 설정해 주어야 한다.

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
아파치 디렉터리에 대한 접근제어(Access control) 설정은 Directory [경로]로 지정한다. 여기서 FollowSymLinks는 심볼릭링크(윈도우의 경우 단축아이콘)를 보안상 사용하지 않는 것이 유리하고, AllowOverride는 인증(.htaccess)에 관여하고 Order는 차단(Deny) 및 허용(Allow)에 대한 기본값을 설정하는데 Deny,Allow는 차단이 기본값이지만 Allow,Deny는 허용을 기본값을 한다. 먼저 Order로 기본값을 설정한 다음 Deny from 과 Allow from으로 차단 및 허용을 지정한다. Satisfy all은 Allow form에 해당하는 경우만 허용하는데 Allow from이 지정되지 않았으므로 모두 Deny가 된다. 시스템 루트이므로 모두 차단된다고 할 수 있다.

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "C:/Program Files/Apache2.2/htdocs">

아파치 기본 설정은 C:/Program Files/Apache2.2/htdoc가 DocumentRoot이다. 이 DocumentRoot를 변경함으로써 자신의 원하는 사이트의 루트를 설정하게 된다 예를들면 d:/www/mysite라는 윈도XP의 폴더로 DocumentRoot를 설정했다면, d:/www/mysite라는 폴더를 Directory 지시어를 통해서 접근 설정을 해주어야 한다. 그렇지 않으면 권한없음(403) 오류를 출력하게 된다.

<Directory "C:/www/mysite">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

IfModule지사자에 의해서 Dir모듈이(mod_dir.so)이 로드되어 졌을때 조건부 설정되며 DirectoryIndex 지시어는 디렉터리의 인덱스페이지를 설정한다. 인덱스 페이지는 파일이름 없이 디렉터리를 요청할 시 기본적으로 연결되는 파일이름이다. 동적페이지가 아닌 경우 index.html 또는 index.htm을 사용한다. 하나 이상의 파일을 순서대로 나열할 경우 앞쪽에 위치할 수록 우선순위가 높다. 예를들면 DirectoryIndex index.html, index.htm, index.php로 지정하면, html, htm, php순으로 우선순위가 부여된다.

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

FilesMatch 지시어는 정규표현식(regular expression)으로 특정한 파일형식을 지정해서 해당 파일에 대한 접근을 설정할 수 있다. 위에 설정은 확장자 ht를 가지는 모든 파일은 인정하지 않고 무시해 버린다.

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error.log

아파치 오류를 기록하는 파일을 지정한다. 아파치가 정상작동을 하지 않을 경우 가장먼저 확인해야할 파일이다. 이 파일의 경로와 연결되는 것은 이미 위에서 ServerRoot를 통해서 지정을 했으므로 ServerRoot/logs/error.log파일이 된다.

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

오류를 기록하는 수준을 지정한다. 기본값은 warn이다. 접속량이 많은 경우 이 로그를 기록하는 자체도 성능에 영향을 줄 수 있으며, 갑자기 서버가 느려지는 경우 로그파일이 비대해 지지 않았는지를 먼저 점검해야 한다. 그러나 그 이전에 적정크기가 되면 새로운 파일로 로그가 기록해주는 것이 좋은 방법이다. 예를들면 3~5Mb 크기 단위로 로그가 기록되도록 해준다.

<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#

mod_log_config는 이용한 기록 아래의 아파치 문서를 참조한다.
http://httpd.apache.org/docs/2.2/ko/mod/mod_log_config.html

LogFormat "%h %l %u %t \"%r\" %>s %b \"%i\" \"%i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

mod_logio를 이용하는 방법은 아래의 아파치 문서를 참조한다.
http://httpd.apache.org/docs/2.2/ko/mod/mod_logio.html

<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%i\" \"%i\" %I %O" combinedio
</IfModule>

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog logs/access.log common
access.log와 error.log 2개만이 설정되어져 있으나 로그파일은 사용자 정의해서 얼마든지 다른 형식으로 저장할 수 있다. mod_rewrite 모듈을 이용할 때도 전용 로그를 생성하고 기록할 수 있다. 로그파일도 성능에 영향을 받는다는 것을 잊어선 안된다.

#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog logs/access.log combined
combined는 사용자 정의로 여러가지 정보를 조합해서 사용한다는 것이고 commin은 공통적으로 사용된다는 레이블 이상의 의미는 없다.</IfModule>

<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://127.0.0.1/bar

Redirect 지시어는 특정한 위치로 재지향(Redirect)할 때 쓴다.
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path

별칭(Alias)을 사용할 수 있는 지시어 Alias는 경로(path)를 짧게 줄이는데 사요한다.

#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "C:/Program Files/Apache2.2/cgi-bin/"

디렉터리를 짧게 줄이는 별칭(Alias)에 스크립전용을 뜻하는 지시어 ScriptAlias는 긴 디렉터리 경로는 짧게 줄이는데 사용한다. cgi-bin이라는 cgi전용 디렉터리를 만들어 이곳에서만 실행이 가능하도록 설정한다. 그러나 홈과 이하 전체의 하위 디렉터리에서 cgi를 실행하려면 아래의 Derectory 지시어가 들어가 부분을 제거한다. 다시말해 별도로 cgi-bin에 대한 접근설정을 별도로 할 필요가 없으며, 홈디렉터리에 대한 접근 권한을 설정할 경우 Options +ExecCGI를 추가해 주면 된다.

</IfModule>

Perl CGI가 작동하지 않는 경우는 대표적으로 2가지 경우이다. 첫번째 500 오류로 내부서버 오류(Internal Server Error)가 발생하는 경우는 Perl 인터프리터 경로가 틀렸을 경우이고, 403 오류로 권한 금지(Access Forbidden)가 표기하는 경우는 Directory 지시어를 통해서 CGI가 실행되도록 설정되지 못한 경우이다.

#
# "C:/Program Files/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Program Files/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
CGI wrapPer로써 특정 디렉터리에서만 CGI가 실행되도록 제한한다. PHP가 워낙 성능이 강력하고 국내 웹환경이 아파치 웹서버에는 PHP가 필수적 사용되므로 특정 디렉터리내에서 CGI가 실행되도록 하는 경우는 이제 거의 드물 것이다. 아파치 메뉴얼에도 웹서버 보안이 잘된다면 특정 디렉터리로 제한을 두지 않아도 상관이 없다고 한다. mod_cgi(d)를 통해서 Perl CGI를 구현하지 않으려면 제거해도 무방하다.

#
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script. For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

#!c:/program files/perl/perl

펄(Perl) CGI를 사용할 때 파일의 첫번째 라인에 Perl 인터프리(해석기: Interpreter)가 설치된 경로를 #!와 함께 기술한다. 만약 펄 인터프리터가 설치되어 있지 않으면 아래 사이트에서 간단히 이름만 입력하고 윈도우용(win32)의 zip나 msi로 다운로드 받아 설치할 수 있다. 2006년 11월 현재 최신 버젼은 5.8.8.819이다
다운로드: http://www.activestate.com/store/activeperl/download/

다운로드후에 Pel설치 경로를 특별히 변경하지 않으면 #!C:/Perl에 설치가 되고 실행파일 perl.exe를 지정해서 #!C:/Perl/bin/perl.exe 을 항상 Perl CGI 파일의 맨앞에 위치시킨다.

# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file. Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention. The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab. Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry

hello.pl파일의 내용을 아래와 같이 작성을 했다고 한다면
#!C:/Perl/bin/perl.exe
print "Content-type: text/html\n\n";
print "Hello, World.";

ScriptInterpreterSource registry를 활성화하면 Perl 해석기 경로인 #!C:/Perl/bin/perl.exe를 생략할 수 있다.

#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.
#

#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

웹서버가 데이타를 전송하는 문서 형식(인터넷 매체)을 지정한다. 기본형식은 단순한 텍스트(plain text)이지만, 지금의 웹 컨텐츠들은 단순한 텍스트 형식만이 아닌 여러가지 다영한 형태의 데이타를 전송하는데, 데이타를 전송하기 전에 먼저 어떤 형식의 데이타를 전송하다는 헤더(Header) 정보를 먼저 전송함으로써 클라이언트 측은 이러한 정보를 받아 데이타에 따른 적절한 프로그램을 작동시키게 된다. 예를들면 PDF문서를 웹서버가 전송할 때 클라이언트 컴퓨터인 윈도XP의 Acrobat Reader가 설치되어져 있어 폴더옵션에 파일형식이 등록되어져 있다면 웹브라우져에 Acrobat Reader가 작동되어져 PDF 문서가 열리게 된다. 이 경우 application/pdf 라는 MIME 형식(Type)을 지정함으로써 가능하다. application형식만이 전송효율을 높히기 위한 텍스트를 압축 전송하는 기술도 사용되므로 이러한 형식에 대한 MIME 형식 정보를 설정해 준다. 동적 페이지를 생성하는 Perl CGI 스크립트, PHP 스크립트들도 이러한 형식을 지정해주어야만 올바르게 웹브라우져에서 출력된다.

<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types

MIME형식 지정되어져 있는 형식파일이 저장되어져 있는 위치와 파일이름이다.

#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

Perl CGI를 작동시키려면 .pl을 아래처럼 추가해 준다.
AddHandler cgi-script .cgi .pl

# For type maps (negotiated resources):
#AddHandler type-map var

#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile conf/magic

인터넷 문서(RFC)의 형식이 지정되어져 있지 않을 때 파일의 내용을 통해 자동적으로 결정하게 되는데 MIMEMagicFile 지시어를 통해서 conf폴더의 하위의 magic파일을 힌트삼아서 문서 형식을 결정하게 된다.
참조: http://httpd.apache.org/docs/2.2/mod/mod_mime_magic.html#mimemagicfile

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://127.0.0.1/subscription_info.html
#

# 하드코드된 오류 메시지(hardcoded error message)로 아파치가 가진 기본적인 오류 메시지(페이지)는 흰색 바탕화면에 검은색 글씨로 그리 보기 좋은 페이지는 아니지만, 사용자정의를 통해서 향상된 오류 페이지를 구성할 수 있다. 위에 설명에 1. 텍스트 방식(사용자정의 메시지 포함), 2. 로컬사이트로 재지향, 3, 외부사이트로 재지향이 가능하다는 예를 보여주고 있다. 재지향(리다이렉트:redirect)을 좀 특별히 서브도메인을 만들고 오류 전용 페이지를 멋지게 디자인해서 보여주는 경우도 있다. 그러나 ErrorDocument 지시어는 굳이 사용하지 않아도 무방하다.
참조: http://httpd.apache.org/docs/2.2/mod/core.html#errordocument

#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall is used to deliver
# files. This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
#
#EnableMMAP off
#EnableSendfile off
EnableMMAP은 메모리대응 (memory-mapping) 또는 메모리멥핑이라고 해서 디바이스 드라이버와 관련된 지식이 있을 경우 제대로 이해가 가능한 옵션인데 실제 아파치 성능향상에 영향을 주는 옵션이지만 자칫 역효과가 발생해서 서버의 성능을 떨어트리고 안정성을 해치는 경우가 있다고 하므로 기본값을 유지한다. EnableSendfile은 커널이 지원하는 메카니즘을 통해서 파일을 전송한다.
참조: http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
참조: http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile

# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.

httpd.conf를 기능별로 분리해서 include함으로써 관리가 용이하다. 사용하지 않거나 필요하지 않은 파일은 주석처리해서 Include하지 않아도 된다. 윈앤위처럼 메모리 적은 상태로 서버를 운영하는 경우 다중 언어처리나 자동 인덱스, 그리고 웹서버에 대한 리얼타임 정보, 아파치 메뉴얼, 웹개발 도구관련 모듈은 Load하지 않는다.

# Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf
Include conf/extra/mpm.conf
# 위에서 말한 다중처리 모듈(MPM)을 설정하는 파일

# Multi-language error messages
#Include conf/extra/httpd-multilang-errordoc.conf
# 에러 메시지를 다중언어로 지원하도록 설정하는 파일

# Fancy directory listings
#Include conf/extra/httpd-autoindex.conf
# 자동 인덱스 생성을 위해 설정을 하는 파일

# Language settings
#Include conf/extra/httpd-languages.conf
# 다중 언어를 지원하기 위한 설정을 하는 파일

# User home directories
#Include conf/extra/httpd-userdir.conf
# 사용자 디렉터리에 대한 설정을 하는 파일

# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf
# 운영되는 웹서버에 관한 상태나 정보출력을 설정하는 파일

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
# IP재사용을 위한 가상호스트(VirtaulHost)를 설정하는 파일

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf
# 아파치 메뉴얼을 직접 웹사이트에서 이용하기 위해 설정하는 파일

# Distributed authoring and versioning (WebDAV)
#Include conf/extra/httpd-dav.conf
# 웹사이트 개발 도구 WebDAV를 지원하는 모듈을 설정하는 파일

# Various default settings
#Include conf/extra/httpd-default.conf
# 아파치 웹서버가 작동하기 위한 기본적인 설정 파일 - 아파일은 특별히 변경할 필요가 있을 경우는 수정된 값을 사용하지만, 대부분의 경우 기본값을 유지한 상태로 아파치는 잘 작동을 한다. 그러나 윈앤위사이트 처럼 조금이라도 아파치 성능을 끌어 올릴 필요 경우라면 많은 시행착오를 통해서 MPM과 함께 최적의 값을 찾아야 한다.

# 아파치기 2.0.xx에서는 httpd.conf가 하나로 구성된 것이 기본이었으나 2.2.x 부터는 분리되어졌다. 그러나 이것은 분리되던 묶여있던 상관이 없다. Include 지시어에 의해서 해당 위치에 해당 파일이 포함되는 것일 뿐이다. 분리되었을 경우는 편집상 편리함이 있기도 하고 반면에 불편한 경우도 있다. 다음번 웹로그에서 httpd.conf의 하위 디렉토리 extra에 위치한 부속 파일들을 분석하기로 한다.

# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

# 지시어 IfModule ssl_module은 보안 소켓 레이어(SSL:Secure Sockets Layer) 모듈이 Load되어질 때 해당하는데, 인터넷을 통해서 비공개문서를 전송하기 위해서 네트스케이프(Netscape)에 의해 개발된 프로토콜의 일종이다. SSL 서버는 http가 아니고 https로 구분할 수 있다. 비용을 들여서 정식으로 SSL인증서를 필요로 하기 때문에 상업 사이트외에 일반적인 웹사이트에서는 사용되지 경우느 드물지만, SSL을 사용함으로써 클라이언트와 서버간의 암호화된 통신을 사용함으로 신뢰성을 높힐 수 있다.

이제껏 httpd.conf 주설정 파일에 대한 내용을 살펴보았다. 보다 자세한 사항은 Extra하위 파일에서 다룬다.

by 아고라 | 2009/03/02 00:00 | 컴퓨터 | 트랙백 | 덧글(0)

Unix 실력 체크

유닉스 사용자 계층

이게 무려 13년전 1995년에 우리과 선배가 동호회게시판에 썼던 글이다.
이걸 볼때 충격이 너무 강해서 유닉스 얘기만 나오면 이 글을 잊을수가 없었다.
그 당시 그 선배가 자기는 hacker 쯤 되는거 같다고 했는데..
13년이 지난 지금의 나는 아직도 expert 에서 헤메고 있는 듯 하다.
그나마 이 글 볼 당시에는 user 수준이었으니 조금 나아지긴 한건가..




초보자(beginner)
- 터미널이라는 개념이 헷갈림
- 아직 vi 의 기초를 모름
- 디렉토리 리스트를 어떻게 해야 보는지 모름
- 매 줄을 입력한 뒤 <리턴> 을 치는데 문제가 있음


초보자(novice)
- `ls' 라고 하면 디렉토리 리스트가 나오는 것을 앎
- 에디터를 사용하긴 하나, `vye' 라고 발음함
- `C' 에 대해서 들어 보긴 했으나 한 번도 사용해 본 적이 없음
- rm 때문에 곤란을 겪은 경험이 있음
- 편지를 어떻게 읽는지 궁금해 함
- 옆에 앉은 사람이 왜 Unix를 저렇게 좋아하는지 궁금해 함

사용자(user)
- vi 와 nroff 을 사용하긴 하나 비 전문적임
- 정규식(regular-expression)에 대해 들어보긴 했으나 본 적은 없음
- 옵션 앞에 `-' 가 붙는다는 것을 알게 됨
- C 프로그램을 짜 보려고 시도했으나 Pascal 을 계속 쓰기로 결정함
- 디렉토리를 옮기려면 어떻게 해야 하는지 궁금해 함
- dbx 는 음향기기의 상표라고 생각함
- 편지를 읽을 줄 알지만 뉴스는 어떻게 읽는지 궁금해 함

좀 아는 사용자 (knowlegable user)
- nroff 을 문제없이 사용하고, tbl 과 eqn 을 배우기 시작함
- 단순한 문자열을 찾기 위해 grep 을 사용함
- mv 가 디렉토리를 옮긴다는 것을 알아냄
- "learn" 명령이 도움이 안된다는 것을 배움
- 누군가가 C 프로그램 짜는 법을 보여줌
- 문장의 일부를 바꾸기 위해 sed 를 한번쯤 써봄
- dbx 를 보긴 했으나 스스로 쓰진 못함
- make 는 무기력한 사람들이나 쓰는 것이라고 생각함

전문가(expert)
- 필요하면 sed 를 씀
- vi 에서 매크로를 쓰고, 필요하면 ex 를 사용함
- 가능한 모든 기회에 뉴스를 포스팅함
- 가끔 csh 스크립트를 씀
- vi 로 C 프로그램을 짜고 cc 로 컴파일 함
- `&&' 와 `||' 가 뭐 때문에 있는지 알게 됨
- 인류의 역사는 `!h' 로 시작됐다고 생각함

해커(hacker)
- 편안하게 sed 와 awk 를 씀
- vi 의 알려지지 않은 기능을 사용함
- `cat >' 으로 C 프로그램을 짜고 `!cc' 로 컴파일 함
- 소스디버거를 믿지 않기 때문에 adb 를 씀
- 사용자 환경에 관한 질문에 대답할 수 있음
- 표준적인 것들을 보충하기위해서 자신이 직접 nroff 매크로를 작성함
- Bourne 쉘(/bin/sh)용 스크립트를 작성함
- 버그 수정(bug fixes)을 어떻게 설치하는지 앎

구루(guru)
- 편한하게 m4 와 lex 를 이용함
- `cat >' 으로 어셈블리 코드를 작성함
- 시스템이 작동되는 중에 adb 로 커널을 조사함
- 소스를 고쳐서 유틸리티들을 자기 취향에 맞게 고침
- 아침을 먹으면서 디바이스 드라이버 소스를 읽음
- 조금 생각하면 어떤 유닉스 명령 질문에도 대답할 수 있음
- 두개 이상의 구별되는 명령이 필요한 작업에는 반드시 make 를 사용함
- 보호장치를 깨는 방법을 배웠으나 더 시도해 볼 필요를 못 느낌

마법사(wizard)
- 디바이스 드라이버를 `cat >' 으로 작성
- 바이너리 화일을 고침으로써 버그를 수정함
- 당신이 물어 보기전에 어떤 질문에도 답할 수 있음
- 자신의 troff 매크로 패키지를 작성함
- Dennis, Bill, Ken 과 절친한 사이임

by 아고라 | 2008/10/02 11:46 | 컴퓨터 | 트랙백 | 덧글(9)

◀ 이전 페이지          다음 페이지 ▶