윈도우 어플리케이션이 실행 중 크래쉬가 발생하는 경우 덤프를 남기로 프로그래밍 할 수 있다.
이렇게 해서 남겨진 덤프파일을 분석하려면 WinDbg를 이용해서 분석할 수 있다.

WinDbg 명령어
1. !analyze -v
읽어들인 덤프파일을 분석한다. pdb 파일들을 로딩하고 스택정보 등을 출력해준다.

2. lm
현재 로딩된 심볼파일(pdb)의 현황을 보여준다.

3. .reload -f
심볼파일을 다시 읽어들인다.

윈도우 프로그래밍 중 ntdll.dll 등의 심볼 파일이 있는 경우가 있는데 이런 때에 다음을 사용하면 된다.


1. Microsoft® Symbol Server
http://msdl.microsoft.com/download/symbols

2. 심볼파일 설치
심볼파일 설치파일을 다운로드 받아 설치하여 사용하는 방법도 있다.
http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx

IE8의 경우 기본적으로 탭 당 프로세스가 1개씩 띄도록 되어있는 구조라 ActiveX 등을 IE로 디버그하기 위해 이용할 수가 없습니다. 즉, ActiveX가 로드된  IE 프로세스가 Visual Studio와 연결된 IE 프로세스와 다르기 때문입니다.

디버그하기 위한 방법이 있는데, IE 프로세스를 1개만 띄도록 하는 것입니다.
아래와 같이 레지스트리에 IE관련 항목을 추가하면 됩니다.

1. 레지스트리 에디터를 연다.
2. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main 키를 연다.
3. TabProcGrowth 라는 DWORD 값을 추가한다.
4. TabProcGrowth의 값을 0으로 설정한다.

위와 같이 설정하면, 이후부터는 IE 프로세스가 1개만 실행됩니다. Visual Studio에서 디버그도 가능하고요.
여러 이유로 실행파일이 동시에 여러 개 실행되지 않도록 하는 방법은 윈도우즈에서는 MUTEX 등을 이용해서 간단히 구현해서 사용하고 있었습니다.

이번 프로젝트에서 리눅스 플랫폼도 지원해야 해서, 리눅스 쪽에서 방법을 찾고 있었는데, 네임드 세마포어로 해결했습니다.

sem_open을 이용해서 네임드 세마포어를 만들고 이걸 검사해서 이미 존재하면 종료하도록 구현했습니다.

BOOL IsRunning()
{
    BOOL ret = FALSE;

    gRunning = sem_open(MY_SEMAPHORE, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, 1);

    if(gRunning == SEM_FAILED)
    {
        if(errno == EEXIST)
        {
            ret = TRUE;
        }
    }

    return ret;
}

생성된 네임드 세마포어는 프로그램 종료시 삭제하면 됩니다.
if (gRunning != NULL)
{
    sem_close(gRunning);
    sem_unlink(MY_SEMAPHORE);
}


쓰레드 등을 생성하기 위해 CPU 갯수를 구해할 일이 있는데, 리눅스 쪽 방법을 찾느라고, 약간 시간이 걸렸다.

1. Windows
SYSTEM_INFO si;
GetSystemInfo(&si);
si.dwNumberOfProcessors;

2. Linux
#include <unistd.h>
sysconf(_SC_NPROCESSORS_CONF);
-1 이면 오류
회사에서 Subversion으로 버전 관리를 하고 있는데, 그동안 Subversion 클라이언트로 TortoiseSVN을 사용해왔다.
새로운 프로젝트들은 Visual Studio 2008로 진행하고 있는데, Visual Studio에 통합되는 Subversion 플러그인은 찾다가, 꽤 쓸만한 놈을 찾았다. Subversion 홈페이지에 "3rd Party Client"로 친절하게 안내도 되어있었는데, 왜 클릭도 안 해봤을까? VisualSVN은 사용이고 AnkhSVN이라는 오픈소스 프로젝트 발견!
아직 하루밖에는 사용 안 해봤지만, 지금까지는 대만족!
저장소 브라우저가 Visual Studio 안에서 보이는 기능이 제일 맘에 듬.^^
다만, 폴더 구조로 커밋하고 하다가 Visual Studio 솔루션탐색기에서 관리하려니 약간 헷갈리기는 한다.
아래는 홈페이지의 스샷 몇개
솔루션 탐색기
저장소 브라우저
영문판 전용 Feature Pack, 영문판 전용 SP1 Beta 만 나오던 Visual Studio 2008 Service Pacek 1이
드디어 발표되었다.
C++를 주로 사용하는 개발자들에게는 MFC 업데이트와 TR1 추가가 가장 큰 변화라 생각된다.
설치파일은 551KB로 다운로드 받은 파일을 실행하면 시스템 검사 후 다시 필요한 파일들을 다운로드 받는다.
발표일자는 2008-08-11

http://www.microsoft.com/downloads/details.aspx?displaylang=ko&FamilyID=fbee1648-7106-44a7-9649-6d9f6d58056e

1.    설치에 앞서

다음은 리눅스 환경에서 Subversion 설치과정과 Subversion과 연동한 Trac 설치방법에 대한 글이다. 리눅스 환경은 Ubuntu를 기준으로 하며, 설치에 사용된 버전은 Ubuntu 8.04 Server 이다. Subversion Apache 웹 서버로 서비스되도록 설치할 것이며, Trac mod_python을 이용한 Apache로 서비스되도록 설치할 것이다.

Subversion Python Binding, mod_python, Genshi Python을 이용한 패키지들은 바이너리 버전을 사용하여 설치할 것이다. 이 경우 해당 시스템에 설치된 Python 버전에 맞는 바이너리 버전을 설치해야 한다. 아래 기술된 설치과정에서는 Python 2.5.1.을 설치하고 이에 맞는 버전들을 설치하는 것으로 설명한다. 또한, Subversion 저장소, Trac 프로젝트 명은 개발 프로젝트에 알맞게 적용하여 사용하길 바란다.

 

2.    설치에 전 작업

Ubuntu 8.04 LTS Server를 설치한다. 설치는 어렵지 않으며, 중간에 파티션 설정, IP 설정을 한 후 패키지 설치가 시작되며, 15 ~ 20분 정도 걸렸다. 설치 후 시스템 업그레이드, 파티션 추가, 기존 소스 DB 설치 등의 작업을 하였다.

2.1.      시스템 업그레이드

시스템 설치가 완료된 후 시스템을 최신 상태로 업그레이드한다.

$ sudo apt-get update

$ sudo apt-get dist-upgrade

 

2.2.      파티션 추가

OS 30GB 정도의 마스터 HDD에 설치했으며, 소스 DB는 별도의 HDD에 설정할 계획으로 두 번째 HDD를 마운트하는 작업이 필요했다. /etc/fstab에 적는 이유는 재부팅시 자동으로 마운트되도록 하기 위함이다.

$ sudo fdisk /dev/sdb

$ sudo mkfs.ext3 /dev/sdb1

$ sudo nano /etc/fstab

/dev/sdb1       /var/lib/svn    ext3    relatime,errors=remount-ro      0       1

$ sudo mount /dev/sdb1

 

2.3.      7-zip 압축 유틸 설치

소스 DB 7-zip으로 압축하여 백업해왔기 때문에, 리눅스 환경에서 압축을 해제하기 위해 7-zip 유틸을 설치한다.

$ sudo apt-get install p7zip

  

3.    Apache 설치

$ sudo apt-get install apache2

  

4.    Subversion 설치

$ sudo apt-get install subversion libapache2-svn

  

5.    Trac 설치

$ sudo apt-get install trac libapache2-mod-python python-setuptools

  

6.    Subversion 저장소 만들기

Subversion 저장소를 만들 디렉터리를 만든 후, Subversion 저장소를 만든다.

이 설치과정에서는 /var/lib/svn디렉터리를 만들고, 여기에 Subversion 저장소를 만든다. 해당 저장소 경로는 Trac 프로젝트를 만들 때 이용한다.

압축해제 또는 디렉터리 생성 후 아래와 같이 소유자를 변경해 주어야 커밋이 정상적으로 된다.

$ sudo mkdir -p /var/lib/svn

 

6.1.      기존 소스 DB 설치

압축받은 소스 DB 파일을 /var/lib/svn에 옮긴 후 압축을 푼다. p7zip–d 옵션만 주면 된다.

 

6.2.      신규 저장소 생성

다음 예는 myproject 라는 저장소를 만드는 경우를 가정한 경우이다.

$ sudo mkdir /var/lib/svn/myproejct

$ sudo svnadmin create /var/lib/svn/myproejct

  

7.    Trac 설정

Trac 으로 관리할 프로젝트를 만든다. 이 설치과정에서는 “/var/lib/trac” 디렉터리를 만들고, 여기에 Trac 프로젝트를 만든다. DB SQLite를 사용하며, 소스 저장소는 Subversion을 사용하도록 설정한다.

웹브라우저에서 접근 가능하도록 소유권도 바꿔준다.

$ sudo mkdir –p /var/lib/trac

$ cd /var/lib/trac

$ sudo trac-admin myproject initenv

# 프로젝트 입력

Project Name [My Project]> myproejct

# DB 연결 설정

Database connection string [sqlite:db/trac.db]> 엔터

# 소스 저장소 타입 설정

Repository type [svn]> 엔터

# 저장소 경로

Path to repository [/path/to/repos]> /var/lib/svn/myproejct

$ sudo chown -R www-data.www-data /var/lib/svn

Trac 프로젝트 생성 작업 완료 후 "Congratulations!" 문구가 나오면 성공적으로 생성된 것이다.

 

7.1.      Trac 관리자 설정

Trac 관리자 계정을 설정할 것을 권장한다. 10장에서 만들 계정 중 관리자 역할을 맡을 계정으로 설정한다.

$ sudo trac-admin testproj permission add usr1 TRAC_ADMIN

  

8.    Trac 프로젝트 수정

Trac 프로젝트를 만든 후 다음 사항들을 수정한다. Trac 프로젝트 별 설정은 프로젝트에 conf 디렉터리의 trac.ini 를 수정해서 조정할 수 있다.

 Ÿ   header_logo

프로젝트 홈 URL을 수정해준다. 첫 페이지의 왼쪽 상단의 이미지를 클릭했을 때 이동할 URL을 설정한다.

link 부분을 수정하면 되고, 이미지도 바꾸려면 src 항목을 수정한다.

[header_logo]

alt =

height = -1

link = http://trac.saerom.co.kr/testproj

src = common/trac_banner.png

width = -1

  

9.    dav_svn_conf 수정

$ sudo nano /etc/apache2/mods-available/dav_svn.conf

 

Subversion을 위한 설정

# dav_svn.conf - Example Subversion/Apache configuration

#

# For details and further options see the Apache user manual and

# the Subversion book.

#

# NOTE: for a setup with multiple vhosts, you will want to do this

# configuration in /etc/apache2/sites-available/*, not here.

 

# <Location URL> ... </Location>

# URL controls how the repository appears to the outside world.

# In this example clients access the repository as http://hostname/svn/

# Note, a literal /svn should NOT exist in your document root.

<Location /svn> <- 주석제거

 

  # Uncomment this to enable the repository

  DAV svn <- 주석제거

 

  # Set this to the path to your repository

  #SVNPath /var/lib/svn

  # Alternatively, use SVNParentPath if you have multiple repositories under

  # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).

  # You need either SVNPath and SVNParentPath, but not both.

  SVNParentPath /var/lib/svn <- 주석제거

  SVNListParentPath on <- 추가

 

  # Access control is done at 3 levels: (1) Apache authentication, via

  # any of several methods.  A "Basic Auth" section is commented out

  # below.  (2) Apache <Limit> and <LimitExcept>, also commented out

  # below.  (3) mod_authz_svn is a svn-specific authorization module

  # which offers fine-grained read/write access control for paths

  # within a repository.  (The first two layers are coarse-grained; you

  # can only enable/disable access to an entire repository.)  Note that

  # mod_authz_svn is noticeably slower than the other two layers, so if

  # you don't need the fine-grained control, don't configure it.

 

  # Basic Authentication is repository-wide.  It is not secure unless

  # you are using https.  See the 'htpasswd' command to create and

  # manage the password file - and the documentation for the

  # 'auth_basic' and 'authn_file' modules, which you will need for this

  # (enable them with 'a2enmod').

  AuthType Basic <- 주석제거

  AuthName "Subversion Repository" <- 주석제거

  AuthUserFile /etc/apache2/dav_svn.passwd <- 주석제거

 

  # To enable authorization via mod_authz_svn

  #AuthzSVNAccessFile /etc/apache2/dav_svn.authz

 

  # The following three lines allow anonymous read, but make

  # committers authenticate themselves.  It requires the 'authz_user'

  # module (enable it with 'a2enmod').

  #<LimitExcept GET PROPFIND OPTIONS REPORT>

    Require valid-user <- 주석제거

  #</LimitExcept>

 </Location>*

 

Trac을 위한 설정

다음 파일의 마지막에 추가한다.

$ sudo nano /etc/apache2/sites-available/default

 

# Trac

<VirtualHost *:80>

    ServerName trac.taekgeun.com

 

    <Location />

        SetHandler mod_python

        PythonHandler trac.web.modpython_frontend

        PythonOption TracEnvParentDir /var/lib/trac

        PythonOption TracUriRoot /

    </Location>

 

    <LocationMatch "[^/]+/login">

        AuthType Basic

        AuthName "Trac Authentication"

        AuthUserFile /etc/apache2/dav_svn.passwd

        Require valid-user

    </LocationMatch>

</VirtualHost>

  

10. htpasswd로 사용자 암호 만들기

htpasswd로 사용자 암호를 만든다. 처음 만들 때만 –c 옵션을 주고 생성한다. 두 번째 사용자 부터는 암호파일명과 사용자 아이디만 입력하면 된다.

$ sudo htpasswd –c /etc/apache2/dav_svn.passwd user1

$ sudo htpasswd /etc/apache2/dav_svn.passwd user2

 

 

 


1.    설치에 앞서

다음은 Subversion 설치과정과 Subversion과 연동한 Trac 설치방법에 대한 글이다. Subversion Apache 웹 서버로 서비스되도록 설치할 것이며, Trac mod_python을 이용한 Apache로 서비스되도록 설치할 것이다.

Subversion Python Binding, mod_python, Genshi Python을 이용한 패키지들은 바이너리 버전을 사용하여 설치할 것이다. 이 경우 해당 시스템에 설치된 Python 버전에 맞는 바이너리 버전을 설치해야 한다. 아래 기술된 설치과정에서는 Python 2.5.1.을 설치하고 이에 맞는 버전들을 설치하는 것으로 설명한다. 또한, Subversion 저장소, Trac 프로젝트 명은 개발 프로젝트에 알맞게 적용하여 사용하길 바란다.

 

 

2.    설치에 필요한 파일들


apache_2.2.8-win32-x86-no_ssl.msi

svn-win32-1.4.6.zip

python-2.5.1.msi

svn-python-1.4.6.win32-py2.5.exe

mod_python-3.3.1.win32-py2.5-Apache2.2.exe

setuptools-0.6c8.win32-py2.5.exe

pysqlite-2.4.1.win32-py2.5.exe

Trac-0.11b1.win32.exe

 

 

3.    Apache 설치

apache_2.2.8-win32-x86-no_ssl.msi 파일을 실행하여 설치한다. 관리자 이에일 주소, 서버명 등을 입력하면 설치된다.

 

 

4.    Subversion 설치

svn-win32-1.4.6.zip 파일을 설치할 경로에 압축을 푼다. 이 문서에서는 C:\svn-win32-1.4.6에 설치하였다.

 

 

5.    Python 설치

Python-2.5.1.msi 를 실행하여 Python을 설치한다. 기본 설치 디렉터리는 C:\Python25이고, 이 설치과정에서는 기본 설정으로 설치한다. 설치 종료 후 재부팅 메시지가 나오고, 재부팅해준다.

 

 

6.    setuptools 설치

Pygmentseasy_install을 이용해 편리하게 설치하기 위해 setuptools를 설치한다.

실행파일은 setuptools-0.6c8.win32-py2.5.exe 이다.

 

 

7.    PATH 등록

Subversion 실행 디렉터리, Python 디렉터리를 환경변수 PATH에 등록한다. 되도록 시스템 변수 쪽에 등록하길 권장한다. ViewVC 설치 중 SYSTEM 계정으로 실행되는 프로세스 들이 Administrator 계정에 등록된 PATH를 인식하지 못해 설치과정 중 고생한 경우가 있었다.

C:\svn-win32-1.4.6;C:\Python25\Scripts

 

 

8.    Subversion Python Binding 설치

Python에서 Subversion 저장소에 접근할 수 있도록 Subversion Python Binding을 설치한다. 실행파일은 svn-python-1.4.6.win32-py2.5.exe이다. 해당 설치된 Python 버전과 맞는 해당 Subversion Python Binding을 설치한다.

설치 과정 중 시스템에서 Python 2.5를 발견했다는 메시지와 설치경로 안내가 나오면, 다음을 눌러 설치한다.

 

 

9.    mod_python 설치

Apache에서 Python을 사용할 수 있도록 mod_python을 설치한다. 실행파일은 mod_python-3.3.1.win32-py2.5-Apache2.2.exe 이다. 시스템에 설치된 Apache 버전과 Python 버전에 맞는 버전으로 설치한다. 이 설치과정에서는 Apache 2.2.8, Python2.5용으로 설치한다.

설치 과정 중 시스템에서 Python 2.5를 발견했다는 메시지와 설치경로 안내가 나오면, 다음을 클릭한다. 파일들을 설치하고 Apache 설치 디렉터리를 물어본다. Apache 설치 경로를 지정해준다. 이번 설치과정에서는 C:\Program Files\Apache Software Foundation\Apache2.2 Apache를 설치했으므로, 위 경로를 지정해준다.

설치 완료 후 C:/Program Files/Apache Software Foundation/Apache2.2\conf\httpd.conf LoadModule python_module modules/mod_python.so 를 추가해주라는 안내문이 나온다. 이후 httpd.conf 파일 수정시 같이 추가한다.

 

 

10. Pygments 설치

Pygments Trac의 소스보기에서 Syntax Highlighting을 지원하기 위해 설치한다.

easy_install을 이용하면 최신버전을 다운로드 받아 설치해준다.

> easy_install Pygments

Searching for Pygments

Reading http://pypi.python.org/simple/Pygments/

Reading http://pygments.org/

Reading http://pygments.pocoo.org/

Best match: Pygments 0.9

Downloading http://pypi.python.org/packages/2.5/P/Pygments/Pygments-0.9-py2.5.egg#md5=67e5ace0841016409084ca1833a55c90

Processing Pygments-0.9-py2.5.egg

creating c:\python25\lib\site-packages\Pygments-0.9-py2.5.egg

Extracting Pygments-0.9-py2.5.egg to c:\python25\lib\site-packages

Adding Pygments 0.9 to easy-install.pth file

Installing pygmentize script to C:\Python25\Scripts

Installing pygmentize-script.py script to C:\Python25\Scripts

Installing pygmentize.exe script to C:\Python25\Scripts

 

Installed c:\python25\lib\site-packages\pygments-0.9-py2.5.egg

Processing dependencies for Pygments

Finished processing dependencies for Pygments

만약 egg 파일을 다운로드 받아놓았다면 다음과 같이 실행시킨다.

> easy_install c:\temp\ pygments-0.9-py2.5.egg

 

 

11. Genshi 설치

Trac에서 HTML rendering에 사용될 Genshi를 설치한다.

> easy_install Genshi

Searching for Genshi

Reading http://pypi.python.org/simple/Genshi/

Reading http://genshi.edgewall.org/

Reading http://genshi.edgewall.org/wiki/Download

Best match: Genshi 0.4.4

Downloading http://ftp.edgewall.com/pub/genshi/Genshi-0.4.4-py2.5.egg

Processing Genshi-0.4.4-py2.5.egg

Moving Genshi-0.4.4-py2.5.egg to c:\python25\lib\site-packages

Adding Genshi 0.4.4 to easy-install.pth file

 

Installed c:\python25\lib\site-packages\genshi-0.4.4-py2.5.egg

Processing dependencies for Genshi

Finished processing dependencies for Genshi

 

 

12. Trac 설치

Trac-0.11b1.win32.exe를 다운로드 받아 실행하여 Trac을 설치한다. 다른 방법은 easy_install 을 이용하여 Trac을 설치할 수도 있다. 실제 설치과정에서는 서버에서 FTP 접속이 불가하여 실행파일을 이용해서 설치하였다.

아래는 easy_install 을 이용한 설치방법이다.

> easy_install trac

 

 

13. Subversion 저장소 만들기

Subversion 저장소를 만들 디렉터리를 만든 후, Subversion 저장소를 만든다.

이 설치과정에서는 c:\svn디렉터리를 만들고, 여기에 Subversion 저장소를 만든다. 해당 저장소 경로는 Trac 프로젝트를 만들 때 이용한다.

> mkdir c:\svn

> svnadmin create c:\svn\testproj

 

 

14. Trac 프로젝트 만들기

Trac 으로 관리할 프로젝트를 만든다. 이 설치과정에서는 “c:\trac” 디렉터리를 만들고, 여기에 Trac 프로젝트를 만든다. DB SQLite를 사용하며, 소스 저장소는 Subversion을 사용하도록 설정한다.

> mkdir c:\trac

> trac-admin c:\trac\testproj initenv

 

# 프로젝트 입력

Project Name [My Project]> testproj

# DB 연결 설정

Database connection string [sqlite:db/trac.db]> 엔터

# 소스 저장소 타입 설정

Repository type [svn]> 엔터

# 저장소 경로

Path to repository [/path/to/repos]> c:\svn\testproj

Trac 프로젝트 생성 작업 완료 후 "Congratulations!" 문구가 나오면 성공적으로 생성된 것이다.

 

 

15. Trac 프로젝트 수정

Trac 프로젝트를 만든 후 다음 사항들을 수정한다. Trac 프로젝트 별 설정은 프로젝트에 conf 디렉터리의 trac.ini 를 수정해서 조정할 수 있다.

 

<!--[if !supportLists]-->Ÿ   <!--[endif]-->header_logo

프로젝트 홈 URL을 수정해준다. 첫 페이지의 왼쪽 상단의 이미지를 클릭했을 때 이동할 URL을 설정한다.

link 부분을 수정하면 되고, 이미지도 바꾸려면 src 항목을 수정한다.

[header_logo]

alt =

height = -1

link = http://trac.saerom.co.kr/testproj

src = common/trac_banner.png

width = -1

 

 

16. httpd.conf 수정

Subversion을 위한 설정

LoadModule dav_module modules/mod_dav.so

LoadModule dav_fs_module modules/mod_dav_fs.so

LoadModule python_module modules/mod_python.so

LoadModule authz_svn_module "C:/svn-win32-1.4.6/bin/mod_authz_svn.so"

LoadModule dav_svn_module "C:/svn-win32-1.4.6/bin/mod_dav_svn.so"

 

# Subversion

NameVirtualHost *:80

 

<VirtualHost *:80>

    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/"

    ServerName svn.taekgeun.com

    ErrorLog "logs/svn.taekgeun.com-error.log"

    CustomLog "logs/svn.taekgeun.com-access.log" common

 

    <Location />

        DAV svn

        SVNParentPath c:/svn/

        SVNListParentPath on

        AuthType Basic

        AuthName "Subversion repository"

        AuthUserFile bin/.htpasswd

        Require valid-user

    </Location>

</VirtualHost>

 

Trac을 위한 설정

# Trac

<VirtualHost *:80>

    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/"

    ServerName trac.taekgeun.com

    ErrorLog "logs/trac.taekgeun.com-error.log"

    CustomLog "logs/trac.taekgeun.com-access.log" common

 

    <Location />

        SetHandler mod_python

        PythonInterpreter main_interpreter

        PythonHandler trac.web.modpython_frontend

        PythonOption TracEnvParentDir c:/trac/

        PythonOption TracUriRoot /

    </Location>

 

    <LocationMatch "[^/]+/login">

        AuthType Basic

        AuthName "Trac"

        AuthUserFile bin/.htpasswd

        Require valid-user

    </LocationMatch>

</VirtualHost>

 

 

17. htpasswd로 사용자 암호 만들기

htpasswd.exe로 사용자 암호를 만든다. 처음 만들 때만 –c 옵션을 주고 생성한다. 두 번째 사용자 부터는 암호파일명과 사용자 아이디만 입력하면 된다.

> cd C:/Program Files/Apache Software Foundation/Apache2.2/bin

> htpasswd –c .htpasswd user1

> htpasswd .htpasswd user2

 

 

설치하고 이것저것 해보다보니 링크시에 에러도 발생하고 제대로 설치된 게 아니었더군요.
오늘 다시 삽집(삽질 좀 꽤 했습니다. 흠...)하고 설치방법이 바뀌어서 수정했습니다. STLport와 boost를 플랫폼SDK를 사용하지 않고 컴파일했습니다.



아래는 VC++ 6 에 STLport 4.6.2과 boost 1.31를 설치한 과정입니다.
STLport iostreams 을 사용하는 경우와 사용하지 않는 경우로 나눠서 설명하고 설치된 STLport를
이용해서 boost를 설치하는 방법을 적었습니다.


STLport 4.6.2 설치하기


1. STLport 다운받기
STLport는 http://www.stlport.org/download.html에서 받을 수 있습니다.


2. STLport 압축풀기
STLport-4.6.2.tar.gz 파일을 압축을 푼 다음 src 디렉토리로 이동한다.
저의 경우 D:\STLport-4.6.2 에 풀었습니다.


4. STLport 컴파일과 설치
STLport iostreams를 사용하는 경우와 사용하지 않는 경우로 나누어서 설명하겠습니다.
아래 과정은 플랫폼SDK를 사용하지 않고 설치한 경우입니다. 플랫폼SDK를 사용하지 않고 컴파일하기 위해
vcvars32.bat 를 실행한 다음 컴파일했습니다.
플랫폼SDK를 사용하실 분들은 아래 참고를 읽어주세요.

* 참고(플랫폼SDK를 사용하여 STLport를 컴파일하는 경우)
플랫폼SDK를 설치하면 환경변수 INCLUDE에 플랫폼SDK경로 부터 들어있습니다. vcvars32.bat를 실행하지 말고
컴파일합니다. 컴파일할때 "InterlockedXXX"관련 에러가 발생하는데
stl_user_config.h 의 다음 부분에 있는 주석을 지우면 됩니다. stlport\stl_user_config.h 파일의 다음 부분에 있는
주석을 지우고 컴파일합니다.
# define _STLP_NEW_PLATFORM_SDK 1

4-1. STLport iostreams를 이용할 경우
아래의 명령을 주면 STLport iostreams를 빌드하고 해당 디렉토리로 설치합니다.
copy 안 하시고 nmake -f 파일명 clean all 이런 식으로 하셔도 됩니다.

vcvars32.bat
copy vc6.mak makefile
nmake clean all
nmake install

nmake install 후에 VC++이 C:\Program Files\Microsoft Visual Studio에 설치되어 있다면
lib, dll 파일은 C:\Program Files\Microsoft Visual Studio\VC98\Lib에
헤더 파일들은 C:\Program Files\Microsoft Visual Studio\VC98\Include\stlport
설치됩니다.

4-2. STLport iostreams를 이용하지 않을 경우
바이너리 파일이 필요없기 때문에 컴파일 과정이 없습니다)
stlport/stl_user_config.h 파일의 다음 부분의 주석을 지우고 stlport 디렉토리를 자신이 사용할 디렉토리에 옮겨서 사용합니다.
# define   _STLP_NO_OWN_IOSTREAMS   1


5. include 디렉토리 지정
VC++ 메뉴에서 Tools -> Options -> Directories 탭에서 Include Files 목록에 4-1이나 4-2의 stlport
경로를 지정해 줍니다. 여기서는 "C:\Program Files\Microsoft Visual Studio\VC98\Include\stlport"
이 됩니다.
라이브러리는 기본적으로 지정된 "C:\Program Files\Microsoft Visual Studio\VC98\Lib" 에 설치되기
때문에 설정해 줄 필요가 없습니다.




boost 1.31 설치하기
아래 설치 방법은 STLport를 이용한 boost 라이브러리를 컴파일해고 설치하는 방법입니다.


1. boost 1.31 다운받기
http://www.boost.org 의 Download에서 다운로드 받는다. SourceForge로 연결되네요.
여기에서 boost_1_31_0.tar.bz2 와 bjam-3.1.9-1-ntx86.zip 를 받습니다.
패치된 파일이 있다면 패치파일도 받습니다. 지금은 regex 패치 파일이 다음과 같은 파일명으로
올려져 있습니다. boost-1.31.0-regex-patch-20040503.zip


2. 압축풀기
다운로드 받은 boost_1_31_0.tar.bz2 을 압축을 풉니다. bjam-3.1.9-1-ntx86.zip 안에 들어있는
bjam.exe를 압축을 푼 boost 디렉토리에 넣습니다. 저의 경우 (D:\boost_1_31_0 에 풀었습니다.)


3. 패치하기
패치압축파일에 들어있는 readme.txt파일을 읽어보시면 지정된 디렉토리에 소스 파일들을 복사하라고 쓰여있습니다.

4. vcvars32.bat 실행

3. bjam 실행하기
bjam에 install 옵션을 주고 실행시키면 C: 드라이브에 Boost라는 디렉토리를 만들고 include, lib 디렉토리에
헤더 파일과 컴파일한 lib, dll 파일을 복사합니다. stage라는 옵션을 주면 설치는 하지 않고 stage라는 디렉토리에
컴파일한 lib, dll 파일 생깁니다.

3-1. STLport iostreams를 사용하지 않는 경우
도스창에서 다음과 같이 입력하면 됩니다. 각 옵션에 대한 설명은 3-2에서 하겠습니다.
 bjam --prefix=c:\boost -sTOOLS=msvc-stlport -sSTLPORT_PATH=D: -sSTLPORT_VERSION=4.6.2 install


3-2 STLport iostreams를 사용하는 경우
기본설정이 사용하지 않음으로 되어 있기때문에 따로 설정을 해주어야합니다. BUILD옵션에 stlport-iostream를
on으로 설정합니다. 이 경우에는 아래와 같습니다. (한줄로 적어야 합니다.)

bjam --prefix=c:\boost \
     -sTOOLS=msvc-stlport \
     -sSTLPORT_PATH=D: \
     -sSTLPORT_VERSION=4.6.2 \
     -sBUILD="debug release <runtime-link>static/dynamic <threading>single/multi <stlport-iostream>on <stlport-cstd-namespace>global" install

각 옵션에 대해 설명을 드리면
--prefix: 설치될 디렉토리
-sSTLPORT_PATH: stlport-x.x.x 형식의 디렉토리가 있는 디렉토리 저의 경우 D:\STLport-4.6.2에 풀었기때문에 d: 라고 적었습니다.
-sSTLPORT_VERSION: 디렉토리 찾을 때 사용되기 때문에 D:\STLport-4.6.2 와 일치되도록 적습니다.
-sBUILD: 빌드옵션
<stlport-iostream>on 만 적어주면 debug모드로만 컴파일됩니다. 그 앞부분도 적어주어야 하더군요.
<stlport-cstd-namespace>global 는 컴파일하면서 vsprintf가 global namespace에 없다고
에러가 발생해서 적어주었습니다.


4. VC++ 셋팅
STLport 설치의 5번 처럼 include, library 디렉토리를 지정해줍니다.
include 디렉토리는 "C:\Boost\include\boost-1_31"로 boost-1_31까지 지정합니다.
소스에서는 #include <boost/regex.hpp>이런 식으로 boost를 적어주어야 합니다.

* 참고
다들 알고 계실꺼라 생각합니다만 혹시 모르시는 분들이 있을까봐 아래 추가합니다.
include 디렉토리와 library 디렉토리를 설정하는 부분이 Tools -> Options -> Directories에만 있는 것은 아닙니다.
STLport나 boost 라이브러리는 설치가 안 되어있는 환경도 있으니 Project Settings에 지정해 놓는 것도 좋습니다.
그 프로젝트에 필요한 헤더파일 경로와 라이브러리 경로를 dsp 파일에 저장시킬 수 있니까 소스를 관리할 때
약간은 편하리라 생각됩니다.
저의 경우에는 VC++을 설치했을때 기본적으로 추가되어있지 않은 헤더파일 경로나 라이브러리 경로는 Project Settings에
지정합니다.

- 헤더 파일 경로 추가
C/C++ 탭에서 Preprocessor를 선택하시고 Additional include directories 에 헤더 파일 경로를 적어줍니다.
여러 경로를 적어 줄때는 comma(',')로 구분하고 적어주시면 됩니다.

- 라이브러리 파일 경로 추가 (라이브러리가 별도의 경로에 있을때)
Link 탭에서 Input을 선택하시고 Additionnal library path 에 라이브러리 경로를 적어줍니다.
마찬가지로 여러 경로를 적어 줄때는 comma(',') 구분하고 적어주시면 됩니다.

원문: http://www.dinkumware.com/vc_fixes.html

(as of 10 Nov 02)

---

The following bug fixes correct problems in the Standard C++ Library that accompanies Microsoft Visual C++ V5.0 and V6.0. Each replacement header file supplied here is represented as a .txt file, so you can view it directly with a web browser. You can also install the replacement file directly from the browser while you are viewing it -- simply select File/Save As File and store the file with the appropriate name in the include directory. YOU ARE STRONGLY ENCOURAGED TO SAVE THE EXISTING HEADER BEFORE OVERWRITING IT.

For example, to replace the header <deque> in a typical VC++ V5.0 installation, choose the directory:

c:\Program Files\DevStudio\VC\include

and save the file with the name deque. Note that some browsers insist on saving the file with the name deque.txt, in which case you will have to rename the file after saving it from the browser.

Be warned that updating a header file does not necessarily trigger a recompilation. You may have to force a rebuild to see the effect of a change.

Note also that some header-file information is captured in DLLs supplied by Microsoft. If you encounter a conflict, you must either avoid using the DLL (by linking statically) or rebuild the offending DLL. We still can supply no information on how to rebuild the standard DLLs shipped with VC++. (Microsoft insists that it's too difficult to describe.)

It is always a good idea to apply the latest Microsoft service pack to upgrade your compiler. Many problems quietly disappear when you do so. For example, you can now get V5.0 SP3 and V6.0 SP3.

DISCLAIMER

The files presented here are copyright ?1995-2000 by P.J. Plauger. All rights reserved. They are for use only in conjunction with a valid license for Microsoft Visual C++ V5.0 or V6.0. Microsoft Corporation is in no way involved with the production or release of these files. The files are offered on an ``as is'' basis. DINKUMWARE, LTD. AND P.J. PLAUGER MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THESE FILES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. DINKUMWARE, LTD. AND P.J. PLAUGER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING THESE FILES.


Fix to <algorithm>

The internal template algorithm _Buffered_merge (two versions) fails to initialize local variables in two places. Change the code as indicated by the comments:

    if (_D2 < _D1)
        {_D1n = _D1 / 2, _D2n = 0;    // clear _D2n
        _Fn = _F;
        advance(_Fn, _D1n);
        _Ln = lower_bound(_M, _L, *_Fn);
        _Distance(_M, _Ln, _D2n); }
    else
        {_D1n = 0, _D2n = _D2 / 2;    // clear _D1n
        _Ln = _M;
        advance(_Ln, _D2n);
        _Fn = upper_bound(_F, _M, *_Ln);
        _Distance(_F, _Fn, _D1n); }

And for the version with predicate:

    if (_D2 < _D1)
        {_D1n = _D1 / 2, _D2n = 0;    // clear _D2n
        _Fn = _F;
        advance(_Fn, _D1n);
        _Ln = lower_bound(_M, _L, *_Fn, _P);
        _Distance(_M, _Ln, _D2n); }
    else
        {_D1n = 0, _D2n = _D2 / 2;    // clear _D1n
        _Ln = _M;
        advance(_Ln, _D2n);
        _Fn = upper_bound(_F, _M, *_Ln, _P);
        _Distance(_F, _Fn, _D1n); }
Fixes to <deque>

The header <deque> (updated 18 October 1999 to V2.33, the latest shipped version) presented here corrects a problem with the representation of the iterator that designates the end of the controlled sequence. If the sequence exactly fills the last allocated block, incrementing the iterator that designates the last element can yield a value that does not match the value returned by end(). The larger the elements stored in the container, the more likely this situation will arise.

The fix is to ensure that every iterator has just one possible representation. For added security, the ends of the container are now guarded with null map pointers. It is no longer possible to step an iterator off either end of the sequence. (Such protection is not required by the C++ Standard, but it makes for nicer failure modes in buggy code.)

 
Fix to <fstream>

(Added 13 October 1999.) The header <fstream> defines template class basic_filebuf (among other things. Its member function _Init contains a bug that causes files opened by name to disable buffering unnecessarily, resulting in a serious degradation of performance. Change the test:

if (_Fp != 0 && !_Closef && sizeof (_E) == 1)

to:

if (_Fp != 0 && sizeof (_E) == 1)

to eliminate this problem.

 
Fix to <istream>

The header <istream> contains a definition for member function basic_istream::getline. It has a lookahead problem -- typing a delimiter to end the input doesn't return control until you type yet another character. Change the code as indicated by the comment:

    else if (_C == _Di)
        {++_Chcount;
        rdbuf()->snextc();    // replace snextc with sbumpc
        break; }

Note that V6.0 replaces snextc with stossc. It is an adequate fix, but you can also apply the above patch safely.


Fix to <list>

(updated 7 July 1998) Both versions of the member function list::sort misplace elements if asked to sort a container with more than 32,768 elements. To fix the first version, change the code as indicated by the comment:

        if (_I == _MAXN)
            _A[_I].merge(_X);
    // SHOULD BE    _A[_I - 1].merge(_X);

Also change the corresponding line in the second version:

        if (_I == _MAXN)
            _A[_I].merge(_X, _Pr);
    // SHOULD BE    _A[_I - 1].merge(_X, _Pr);

You might also consider increasing _MAXN from 15 to, say 25. That way, you would have to sort a list of more than 32 million elements, instead of 32 thousand, before the performance begins to degrade.


Fix to <memory>

Template class auto_ptr creates two owners for an object if you copy an auto_ptr object back to a previous owner that still stores the same object pointer. To eliminate this problem, change the code in auto_ptr::operator= as indicated by the comment:

    else if (_Y._Owns)
        _Owns = true;    // _Owns = true, _Y.release();

Note that this template class has been redesigned more than once since this version of the library was frozen. No attempt is made here to track those changes.

 
Fix to <sstream>

(Added 12 November 1999.) Class basic_stringbuf grows its buffer by fixed-size increments, which can be very slow if the buffer gets very large. To grow the buffer exponentially, replace the line in basic_stringbuf::overflow that reads:

    size_t _Ns = _Os + _Alsize;

with:

    size_t _Ns = (_Os < _Alsize) ? _Os + _Alsize : 2 * _Os + 1;
Fix to <string>

The header <string> contains a definition for template function getline. It has a lookahead problem -- typing a delimiter to end the input doesn't return control until you type yet another character. Change the code as indicated by the comment:

    else if (_Tr::eq(_C, _D))
        {_Chg = true;
        _I.rdbuf()->snextc();    // replace snextc with sbumpc
        break; }
Fix to <vector>

The header <vector> sometimes fails to extend a vector properly. In two versions ofinsert, change the code as shown:

        _Destroy(_First, _Last);
        allocator.deallocate(_First, _End - _First);
        _End = _S + _N;
        _Last = _S + size() + _M;
        _First = _S; }

        _Destroy(_First, _Last);
        size_type _O = size();    // add this statement
        allocator.deallocate(_First, _End - _First);
        _End = _S + _N;
        _Last = _S + _O + _M;    // was _Last = _S + size() + _M;
        _First = _S; }
Fix to <xmemory>

Template class _Destroy has an unfortunate interaction with a bug in the VC++ compiler. It gets confused if you ask it to destroy an object of a class that defines the name _Ty. (Template class complex is one such creature.) The best workaround is to replace the template parameter _Ty with a really strange name, as in:

        // TEMPLATE FUNCTION _Destroy
template<class _Xyzzy> inline
    void _Destroy(_Xyzzy _FARQ *_P)
    {_DESTRUCTOR(_Xyzzy, _P); }
Fixes to <xstring>

The header <xstring> (original 25 May 1998) presented here corrects a problem with string assignments. Assigning a shorter sequence to an existing string can cause the old string to be copied in full to the newly allocated area, thus causing a storage overwrite, and an occasional storage leak as a result. In rarer circumstances, a string is partially altered by a replace member function before the copy on write occurs, thus causing changes to an apparently unrelated string object.

The fix is a small but significant change to the private member function _Grow. Several calls to _Freeze, to force a copy on write, are also added.

Please note that this implementation is still not as thread safe as it should be, because of the reference-counted implementation. A write to a ``copy'' of a string in one thread can confuse a read of that string in another thread, because the two still secretly share the same representation. One way to ensure that the non-const string str has a private representation is to call str.begin(). (By creating a mutable iterator into the string, you rule out sharing of representations.) Another way is to disable reference-counting altogether, making string operations thread safe. Simply change the value of _FROZEN to zero:

    enum _Mref {_FROZEN = 255};  // set to zero to disable sharing
Fix to <xtree>

The header <xtree> (original 25 June 1998) presented here eliminates all need for thread locks and corrects a number of thread-safety issues for template classes map, multimap, set, and multiset. It also solves some nasty problems with sharing these classes across DLLs. Note that no attempt has been made to retrofit the changes needed to make these template classes exception safe in the sense required by the final C++ Standard. (The headers map and set once presented here have been dropped as of 4 April 1999 -- they were effectively unchanged over the shipped versions.)

Fix to strftime.c

The Microsoft C library file strftime.c (original 28 March 2000) fails to supply locale information needed for the %X conversion specifier used by template class time_put. To fix the problem, add the missing line shown below to the function _Gettnames. Change the code from:

    s += strlen(strcpy(s, pt->ww_ldatefmt)) + 1;
    pn->ww_timefmt = s; }

to:

    s += strlen(strcpy(s, pt->ww_ldatefmt)) + 1;
    pn->ww_timefmt = s;
    strcpy(s, pt->ww_timefmt); }

NB: You need to make this change even if you licensed the v3.08 upgrade library from Dinkumware. We do not supply a replacement for it.

+ Recent posts