Computing/Programming2009/05/16 22:19
이 포스트는 널리 사용되고 있는 버전 관리 시스템(Version Control System, VCS) 중 하나인 서브버전(Subversion, SVN)을 설치하고, 이클립스와 연동하는 방법에 관해 기술한다.

VCS 및 서브버전에 관한 자세한 내용은 다음의 링크를 참조하라.

- http://betterexplained.com/articles/a-visual-guide-to-version-control/
- http://subversion.tigris.org/

설치 환경은 다음과 같다.

  • 서버 OS: 데비안 GNU/Linux 5.0 Lenny
  • 클라이언트 OS: Ubuntu 8.04 Hardy Helon
  • SVN 버전: 1.5.1dfsg1-2
  • 이클립스 버전: 3.4.2 (Ganymede), build id: M20090211-1700
  • Apache HTTP 서버 버전: 2.2.9-10+lenny2

아래에서 명령어 실행 시 명령 프롬프트의 모양이 '$'이면 일반 사용자 권한으로, '#'이면 관리자 권한으로 실행하여야 한다.


1. SVN 설치

다음의 명령어를 관리자 권한으로 실행하여 SVN과 SVN tools 패키지를 설치해 준다.

# apt-get install subversion subversion-tools


다음과 같이 SVN 저장소(repository)의 루트가 될 디렉터리를 만들어 준다.

# mkdir -p /var/lib/svn


다음의 명령어로 프로젝트 디렉터리를 SVN 저장소 내에 생성하여 준다.

# svnadmin create /var/lib/svn/test


위에서는 프로젝트 디렉터리 명을 'test'로 하였다.

보통 SVN 저장소의 프로젝트 디렉터리 하부의 디렉터리 구조, 즉 디렉터리 레이아웃은 'trunk', 'tag', 'branches' 세 개로 구성된다. 이클립스에서 Subversive라는 플러그인을 이용하여 SVN과 연동하면 이 레이아웃을 지정해 줄 수 있기 때문에 필요 없는 과정이지만, 만약 이클립스와 연동을 할 것이 아니라면 다음과 같이 각 디렉터리들을 추가하여 레이아웃을 구성하면 된다.

# svn mkdir file:///var/lib/svn/test/trunk -m "Trunk"
# svn mkdir file:///var/lib/svn/test/tags -m "Tags"
# svn mkdir file:///var/lib/svn/test/branches -m "Branches"


2. WebDAV SVN 지원 모듈 설치 및 설정


SVN 저장소가 웹으로부터 접근 가능하도록 하기 위해서는 WebDAV SVN 지원 모듈 사용하면 된다. WebDAV SVN 지원 모듈은 libapache2-svn 패키지에 포함되어 있다. 다음과 같이 설치한다.

# apt-get install libapache2-svn


설치가 끝나면 설정을 해준다. /etc/apache2/mods-available/dav_svn.conf 파일을 수정한다.

# vi /etc/apache2/mods-available/dav_svn.conf


dav_svn.conf 파일이 아래와 같이 되도록 주석을 해제하거나, 추가 혹은 수정한다.

<Location /svn>
  DAV svn
  SVNParentPath /var/lib/svn

  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /var/lib/htpasswd/htpasswd

  <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  </LimitExcept>
</Location>


위에서 /var/lib/htpasswd/htpasswd 파일은 이전 포스트에서 나와 있다시피 Trac 설치 시 htpasswd 명령어로 만든 파일로써, 사용자 계정 정보가 암호화 되어 들어 있다. 사용자를 추가하고 싶으면 다음과 같이 하면 된다.

# htpasswd -cm /var/lib/htpasswd/htpasswd <추가할 계정명>


또한 위에서 <LimitExcept/> 앨리먼트를 바디의 내용(Require valid-user)는 제외하고 태그만 제거하면 해당 주소로 접근 시 계정명 및 암호 입력창을 띄워 인증된 사용자만이 해당 페이지를 볼 수 있게 한다.

위 dav_svn.conf 파일은 libapache2-svn 패키지 설치 시 /etc/apache2/mods-available 디렉터리에 생성되어, 자동으로 /etc/apache2/mods-enabled 디렉터리에 심볼릭 링크가 생성된다. 만약, mods-enabled 디렉터리에 dav_svn.conf 파일의 심볼릭 링크가 없다면 다음의 명령어로 추가해 준다.

# a2enmod /etc/apache2/mods-available/dav_svn


이 때, dav_svn.load 파일도 정상적으로 심볼릭 링크되어 있는지 확인한다. 그 파일이 있어야 WebDAV SVN 지원 모듈이 아파치에 정상적으로 로드된다.

아파치를 재시작하기에 앞서서 다음의 명령어로 /var/lib/svn 디렉터리 및 하위 모든 디렉터리의 소유자 및 소유그룹을 www-data로 변경한다.

# chown -R www-data.www-data /var/lib/svn/


아파치를 재시작한다.

# /etc/init.d/apache2 restart


여기까지 완료되면, 다음의 주소로 접속하여 제대로 설정되었는지 확인한다.

http://localhost/svn/test/

3. Subversive 플러그인 설치 및 설정

이클립스에서 SVN을 연동하기 위한 플러그인으로는 Subversive와 Subclipse 등을 들 수 있다. 여기서는 현재 이클립스 하위 프로젝트로 포함되어 현재 incubation 상태로 개발 중에 있는 Subversive를 사용하도록 한다.

Subversive를 사용하기 위해 이클립스의 'Help' 메뉴 -> 'Software Updates...' -> 'Available Software' 탭의 'Add Site...' 버튼을 눌러 다음과 같은 업데이트 사이트를 추가한다.

http://download.eclipse.org/technology/subversive/0.7/update-site/
http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/


첫 번째 업데이트 사이트는 Subversive 플러그인 설치를 위한 것이며, 두 번째 업데이트 사이트는 Subversive SVN 커넥터 플러그인 설치를 위한 것이다.

추가한 두 업데이트 사이트의 체크박스에 체크인하고 'Install...' 버튼을 눌러 포함된 모든 플러그인들을 설치하는데, 혹 오류로 설치가 잘 안될 경우 다음의 플러그인들만을 체크인하고 설치를 진행하도록 한다.

http://download.eclipse.org/technology/subversive/0.7/update-site/
└Subversive SVN Integration for the Mylyn Project (Optional) (Incubation)
└Subversive SVN JDT Ignore Extensions (Optional) (Incubation)
└Subversive SVN Team Provider (incubation)
└Subversive SVN Team Provider Localization (Optional) (Incubation)
└Subversive SVN Team Provider Sources (Incubation)
http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/
└Subversive SVN Connectors
└SVNKit 1.3.0 Implementation (Optional)


이 글을 작성하는 시점에서 각 플러그인의 버전은 Subversive SVN Connectors 및 SVNKit 1.3.0 Implementation만 2.2.0.I20090505-1500이고 나머지는 모두 0.7.8.I20090506-1500이다.

설치가 완료되면 이클립스의 'Window' 메뉴 -> 'Open Perspective' -> 'Other...'에서 'SVN Repository Exploring'를 선택하여 퍼스펙티브를 전환한다. SVN Repository Exploring 퍼스펙티브로 전환하면 왼편에 SVN Repositories 뷰가 위치하게 된다.

SVN Repositories 뷰에서 마우스 우클릭 -> 'New' -> 'Repository Location...'을 클릭하면 'New Repository Location' 창이 열리는데 여기서 연결할 SVN 저장소에 관한 정보를 입력해 주고 'Finish' 버튼을 눌러 설정을 완료한다.

제대로 연결이 되면 SVN Repositories 뷰에서 좀 전에 생성한 SVN 저장소의 내용을 볼 수 있을 것이다. 설정에 따라 사용자 인증이 필요할 수도 있다.

이클립스 프로젝트를 SVN 저장소에 최초로 등록하기 위해서는 'Project Explorer' 뷰에서 해당 프로젝트를 마우스 우클릭하여 'Team' -> 'Share Project...' 메뉴를 실행한 후, 저장소 플러그인 선택창에서 SVN 플러그인을 선택한다. 그 다음에 저장소 위치를 선택하는 창이 뜨는데 여기서 좀 전에 등록했던 저장소 위치를 선택하고, 'Next' 버튼을 누른다.

해당 저장소에 하나의 프로젝트만 관리할 수 있게 하기 위하여, 'Name on Repository' 영역을 'Use empty name'으로 설정하고, 'Project Repository Layout' 영역을 'Use single project layout'으로 설정한다. 'Finish' 버튼을 누르면 commit message를 입력하는 창이 뜨고, 적절한 message를 입력한 후, 'OK' 버튼을 누르면 등록이 완료된다. 이후에는 프로젝트 및 프로젝트 리소스 노드에서 마우스 우클릭하여 나오는 팝업 메뉴의 Team 메뉴에 다양한 VCS 관련 메뉴들이 추가된다.

* 참고
- http://ariejan.net/2006/12/01/how-to-setup-a-ubuntu-development-server-part-1
- http://blog.daum.net/kuh74/7583052
- http://www.eclipse.org/subversive/documentation/gettingStarted/aboutSubversive/install.php
- http://www.eclipse.org/subversive/downloads.php
- http://www.polarion.com/products/svn/subversive.php?src=eclipseproject
- 자바 프로젝트 필수 유틸리티, 박재성, 한빛미디어(주), 2009

Posted by pcandme

TRACKBACK http://pcandme.net/trackback/66 관련글 쓰기

  1. [소프트웨어형상관리] SCM도구 서브버젼 설치법, 서브버젼의 설정과 사용법.(SubVersion installation guide)  삭제

    2010/07/28 00:30TRACKBACK FROM 월풍도원(月風道院) - Delight on the Simple Life.

    이미지출처 : blog.codesion.com SCM(software configuration management)도구의 하나인 SVN의 설치 및 설정방법을 여러 웹페이지를 참조하여 간단하게 사용법을 정리해 보았다. ————————————————- 서브버젼 설정 ————————————————- 1. 서브버젼을 설치한다. (http://subclipse.tigris.org/) 2. 저장소를 생성한다. svn설치폴더\bin\svnadmin create..

댓글을 달아 주세요

Computing/Programming2009/05/16 14:43
Trac은 향상된 위키 및 이슈 추적 시스템으로, 내 서버에 이를 설치하고 지난 포스트에 그 설치 기록을 포스팅하였다. 이 포스트에서는 설치된 Trac과 이클립스를 연동하기 위해 Mylyn 플러그인을 설치하고 설정하는 방법에 관해 기술한다. 여기서 기술할 설치 방법은 내가 설치 및 설정을 하면서 따랐던 순서에 기반하며, 시스템에 따라서 그 방법 및 순서가 상이할 수도 있음을 미리 말해둔다.

설치 환경은 다음과 같다.

  • OS: 데비안 GNU/Linux 5.0 Lenny
  • Trac 버전: 0.11.1-2.1
  • 이클립스 버전: 3.4.2 (Ganymede), build id: M20090211-1700


1. Trac XmlRpc 플러그인 설치


http://trac-hacks.org/wiki/XmlRpcPlugin에서 xmlrpcplugin-r5751.zip 파일을 다운로드 한 후, 압축을 해제하고 압축을 해제한 디렉터리에서 trunk 디렉터리로 이동한다.

$ cd trunk


trunk 디렉터리에서 관리자 권한으로 다음을 실행한다.

# python setup.py bdist_egg

running bdist_egg
running egg_info
creating TracXMLRPC.egg-info
writing TracXMLRPC.egg-info/PKG-INFO
writing top-level names to TracXMLRPC.egg-info/top_level.txt
writing dependency_links to TracXMLRPC.egg-info/dependency_links.txt
writing entry points to TracXMLRPC.egg-info/entry_points.txt
writing manifest file 'TracXMLRPC.egg-info/SOURCES.txt'
...
(중략)
...
creating dist
creating 'dist/TracXMLRPC-1.0.0-py2.5.egg' and adding 'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)


위 명령이 정상적으로 실행되고 나면 trunk 디렉터리 내에 dist 디렉터리가 생겼을 것이다. dist 디렉터리로 이동하여 다음의 명령어로 플러그인을 설치한다.

# cd dist
# easy_install TracXMLRPC-1.0.0-py2.5.egg

Processing TracXMLRPC-1.0.0-py2.5.egg
Copying TracXMLRPC-1.0.0-py2.5.egg to /usr/lib/python2.5/site-packages
Adding TracXMLRPC 1.0.0 to easy-install.pth file

Installed /usr/lib/python2.5/site-packages/TracXMLRPC-1.0.0-py2.5.egg
Processing dependencies for TracXMLRPC==1.0.0
Finished processing dependencies for TracXMLRPC==1.0.0


위와 같이 실행되면 XmlRpcPlugin이 제대로 설치된 것이다. 다음과 같이 아파치 서버를 재시작한다.

# /etc/init.d/apache2 restart

이제 Trac 프로젝트 사이트에 관리자로 로그인 하여, 'Admin' 메뉴 페이지 내 'General' 카테고리의 하위 메뉴인 'Plugin' 메뉴에서 'TracXMLRPC 1.0.0' 플러그인의 모든 컴포넌트를 활성화 한다.

그런 다음, 'Permissions' 메뉴를 클릭하여 'Manage Permissions' 페이지로 들어간다. 당 페이지의 오른쪽에 보면 'Grant Permission' 폼 그룹이 있는데, 여기서 XmlRpc API를 사용할 계정을 'Subject' 입력 폼에 입력하고, 아래의 'Action' 드롭 다운 리스트에서 'XML_RPC'를 선택한 후, 'Add' 버튼을 눌러 XmlRpc 사용 계정을 등록한다. Subject에는 특정 사용자 계정명 또는 그룹명이 들어갈 수 있다.

여기까지 하면 Trac에서의 설정은 완료된다.

2. 이클립스 Mylyn 플러그인 설치 및 설정

2-1. Mylyn 플러그인 설치

이클립스의 Mylyn 플러그인은, Java EE 개발자 용 이클립스 패키지의 경우 기본적으로 설치가 되어 있다. 만약, 설치가 되어 있지 않다면 이클립스의 'Help' 메뉴 -> 'Software Updates...' -> 'Available Software' 탭에서 'Ganymede Update Site' -> 'Collaboration Tools'를 클릭하여 펼쳐지는 하위 노드 중 Mylyn 관련 플러그인을 모두 설치한다. 설치가 완료되면 이클립스를 재시작 한다.

2-2. Mylyn Trac 연결 플러그인 설치

Help 메뉴 -> Software Updates... -> Available Software 탭에서 'Manage Sites...' 버튼을 눌러 다음의 업데이트 사이트를 활성화 한다.

http://download.eclipse.org/tools/mylyn/update/extras

Available Software 탭에서 'mylyn'으로 검색하면 나오는 플러그인 중에, 'Mylyn Extras' -> 'Mylyn Integration' -> 'Mylyn Connetor: Trac'을 선택하여 설치한다. 설치 완료 후, 뜨는 재시작 여부를 묻는 대화창에서 'Yes'를 선택해 이클립스를 재시작한다.

2-3. 이클립스 Trac 연동 확인

이클립스의 'Winodw' 메뉴 -> 'Show View' -> 'Other...' -> 'Tasks' 또는 'Mylyn' -> 'Task Repositories'를 눌러 Task Repositories 뷰를 현재의 퍼스펙티브에 표시한다.

Task Repositories 뷰에서 마우스 우클릭하여 컨텍스트 메뉴를 띄운 다음, 'Add Task Repository'를 선택하면 Trac 커넥터를 볼 수 있는데, 이를 선택하고, 'Next' 버튼을 누른다.

이제 서버의 URL을 입력 및 레이블을 입력하고, 바로 아래에서 오른쪽에 있는 'Anonymous' 체크 박스 버튼에 체크를 해제하여 'User ID' 항목과 'Password' 항목을 활성화 한다음 Trac 프로젝트 사이트에서 XmlRpc API 사용 계정으로 등록했던 계정 정보를 입력한다.

아래의 'Additional Settings'를 확장하면 'Access Type' 드롭 다운 리스트가 보이는데, 여기서 'XML-RPC Plugin (Rev. 1950)'을 선택한다.

이제 설정을 확인하기 위해 아래 'Validate Setting' 버튼을 누른다. 접속에 성공하면 상단에 다음과 같은 메시지가 나타난다.

Authentication credentilas are valid.

위와 같은 메시지가 나타나면 'Finish' 버튼을 눌러 설정을 완료한다.

* 참고
- http://trac-hacks.org/wiki/XmlRpcPlugin
- 자바 프로젝트 필수 유틸리티, 박재성, 한빛미디어(주), 2009
Posted by pcandme

TRACKBACK http://pcandme.net/trackback/65 관련글 쓰기

댓글을 달아 주세요

Computing/Programming2009/05/14 22:36
이 포스트는 오늘 내가 나의 데비안 서버에 "Trac"이라는 이슈 관리 시스템을 설치한 경험을 기반으로 정리해 본 설치 방법에 관한 포스트이다. Trac 홈페이지에서는 Trac을 다음과 같이 소개하고 있다.

Trac is an enhanced wiki and issue tracking system for software development projects. Trac uses a minimalistic approach to web-based software project management. Our mission is to help developers write great software while staying out of the way. Trac should impose as little as possible on a team's established development process and policies.

이 포스트는 나의 설치 경험에 기반하므로, 환경이 다른 시스템에서는 제대로 되지 않을 수 있으며, 단지 Trac 설치 시 참고는 가능하리라 생각한다.

설치 환경은 다음과 같다.

  • OS: 데비안 GNU/Linux 5.0 Lenny
  • HTTP 서버: Apache 2.2.9-10+lenny2
  • HTTP 서버 연동: mod_python 모듈
  • Trac 버전: 0.11.1-2.1

1. 필요 패키지 설치


다음과 같이 필요 패키지를 설치해 준다.

# apt-get update; apt-get install libapache2-mod-python libapache2-mod-python-doc trac

내 시스템의 경우, 아파치는 이미 설치되어 있었기 때문에 제외하였으며, 그외에 Trac 설치에 필요한 패키지들은 의존성에 의해 전부 설치 된다.

2. 필요 디렉터리 생성

다음과 같이 필요 디렉터리를 생성하고 소유권을 아파치의 실행 UID인 www-data로 지정해 준다.

# mkdir /var/lib/svn
# chown -R www-data:www-data /var/lib/svn/
# mkdir /var/lib/trac
# chown -R www-data:www-data /var/lib/trac/
# mkdir /var/lib/htpasswd
# chown -R www-data:www-data /var/lib/trac/

서브버전과의 연동을 염두에 두고 있다면, 위와 같이 서브버전 저장소의 루트로 사용할 디렉터리를 '/var/lib/svn'으로 미리 생성해 준다. 이는 Trac의 설치 과정 중 설정값으로 넣을 서브버전 저장소의 프로젝트 디렉터리의 상위 디렉터리가 될 것이다. Trac의 환경 디렉터리 또한 위와 같이 '/var/lib/trac'으로 생성해 준다. '/var/lib/htpasswd' 디렉터리는 Trac 접속 계정 정보 파일이 저장될 디렉터리이다. 이 디렉터리들은 임의의 위치에 생성될 수 있다.

3. Trac 프로젝트 생성

Trac의 프로젝트를 다음과 같이 생성해 준다. 여기서는 프로젝트의 디렉터리 명을 'test'로 하였다. 생성 과정 중 입력해야 할 것은 볼드체로 표기하였다.

# trac-admin /var/lib/trac/test initenv

Creating a new Trac environment at /var/lib/trac/test

Trac will first ask a few questions about your environment
in order to initialize and prepare the project database.

 Please enter the name of your project.
 This name will be used in page titles and descriptions.

Project Name [My Project]> Test
 
 Please specify the connection string for the database to use.
 By default, a local SQLite database is created in the environment
 directory. It is also possible to use an already existing
 PostgreSQL database (check the Trac documentation for the exact
 connection string syntax).

Database connection string [sqlite:db/trac.db]> [Enter]
 
 Please specify the type of version control system,
 By default, it will be svn.

 If you don't want to use Trac with version control integration,
 choose the default here and don't specify a repository directory.
 in the next question.

Repository type [svn]> [Enter]

 Please specify the absolute path to the version control
 repository, or leave it blank to use Trac without a repository.
 You can also set the repository location later.

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

Creating and Initializing Project
 Installing default wiki pages
 CamelCase imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/CamelCase
 InterMapTxt imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/InterMapTxt
 InterTrac imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/InterTrac
 InterWiki imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/InterWiki
 PageTemplates imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/PageTemplates
 RecentChanges imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/RecentChanges
 SandBox imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/SandBox
 TitleIndex imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TitleIndex
 TracAccessibility imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracAccessibility
 TracAdmin imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracAdmin
 TracBackup imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracBackup
 TracBrowser imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracBrowser
 TracCgi imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracCgi
 TracChangeset imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracChangeset
 TracEnvironment imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracEnvironment
 TracFastCgi imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracFastCgi
 TracFineGrainedPermissions imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracFineGrainedPermissions
 TracGuide imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracGuide
 TracImport imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracImport
 TracIni imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracIni
 TracInstall imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracInstall
 TracInterfaceCustomization imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracInterfaceCustomization
 TracLinks imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracLinks
 TracLogging imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracLogging
 TracModPython imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracModPython
 TracNavigation imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracNavigation
 TracNotification imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracNotification
 TracPermissions imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracPermissions
 TracPlugins imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracPlugins
 TracQuery imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracQuery
 TracReports imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracReports
 TracRevisionLog imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracRevisionLog
 TracRoadmap imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracRoadmap
 TracRss imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracRss
 TracSearch imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracSearch
 TracStandalone imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracStandalone
 TracSupport imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracSupport
 TracSyntaxColoring imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracSyntaxColoring
 TracTickets imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracTickets
 TracTicketsCustomFields imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracTicketsCustomFields
 TracTimeline imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracTimeline
 TracUnicode imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracUnicode
 TracUpgrade imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracUpgrade
 TracWiki imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracWiki
 TracWorkflow imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/TracWorkflow
 WikiDeletePage imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiDeletePage
 WikiFormatting imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiFormatting
 WikiHtml imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiHtml
 WikiMacros imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiMacros
 WikiNewPage imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiNewPage
 WikiPageNames imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiPageNames
 WikiProcessors imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiProcessors
 WikiRestructuredText imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiRestructuredText
 WikiRestructuredTextLinks imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiRestructuredTextLinks
 WikiStart imported from /usr/lib/python2.5/site-packages/trac/wiki/default-pages/WikiStart

---------------------------------------------------------------------
Warning: couldn't index the repository.

This can happen for a variety of reasons: wrong repository type,
no appropriate third party library for this repository type,
no actual repository at the specified repository path...

You can nevertheless start using your Trac environment, but
you'll need to check again your trac.ini file and the [trac]
repository_type and repository_path settings in order to enable
the Trac repository browser.


---------------------------------------------------------------------
Project environment for 'GIST Simulation Portal' created.

You may now configure the environment by editing the file:

  /var/lib/trac/test/conf/trac.ini

If you'd like to take this new project environment for a test drive,
try running the Trac standalone web server `tracd`:

  tracd --port 8000 /var/lib/trac/test

Then point your browser to http://localhost:8000/test.
There you can also browse the documentation for your installed
version of Trac, including information on further setup (such as
deploying Trac to a real web server).

The latest documentation can also always be found on the project
website:

  http://trac.edgewall.org/

Congratulations!


이 과정을 마치고 나면 Trac의 환경 디렉터리(여기선 /var/lib/trac) 아래에 프로젝트 디렉터리 및 내부의 파일들이 새로 생성되므로 이 모든 디렉터리 및 파일들에 아파치가 접근할 수 있도록 다음과 같이 소유권을 변경한다.

# chown -R www-data:www-data /var/lib/trac

4. 웹 서버(아파치) 연동

아파치 연동을 위해 /etc/apache2/site-available 디렉터리에 'trac'이라는 파일을 만들고, 아래와 같이 가상 호스트 설정을 해준다. 아래는 8080 포트에서 Trac 프로젝트 사이트가 서비스 될 수 있도록 한 것이다.

# vi /etc/apache2/site-available/trac

NameVirtualHost *:8080
<VirtualHost *:8080>
    <Location /trac>
        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnvParentDir /var/lib/trac
        PythonOption TracUriRoot /trac
    </Location>

    <LocationMatch "/trac/[^/]+/login">
        AuthType Basic
        AuthName "Trac, Issue Tracking and Documenting"
        AuthUserFile /var/lib/htpasswd/htpasswd
        Require valid-user
    </LocationMatch>
</VirtualHost>

추가한 가상 호스트 설정을 다음의 명령어로 /etc/apache2/sites-enabled 디렉터리에 추가한다.

# a2ensite trac

아파치를 재시작하고, Trac에 접속하여 잘 설치되었는지 확인한다.

# /etc/init.d/apache2 restart

http://localhost:8080/trac

위 페이지에서 프로젝트 목록이 링크로 제대로 출력되는 것을 볼 수 있어야 한다.

5. 관리자 계정 추가

다음과 같이 관리자 계정을 생성하고, Trac 프로젝트에 등록한다.

# htpasswd -cm /var/lib/htpasswd/htpasswd admin
# chown -R www-data:www-data /var/lib/htpasswd
# trac-admin /var/lib/trac/test permission add admin TRAC_ADMIN

6. 필수 플러그인 설치

Trac 사용에 필수적인 다음의 플러그인들을 설치한다.

  • IniAdminPlugin - Trac 프로젝트의 환경 설정 시 <프로젝트 디렉터리>/conf/trac.ini 파일을 직접 수정하는 대신에 웹 환경에서 할 수 있게 해주는 플러그인이다.
  • AccountManagePlugin - 계정의 생성 및 수정, 삭제를 관리하는 플러그인이다.
  • TimingAndEstimationPlugin - 태스크 관리 시 일정을 예측하고 작업한 시간을 관리하는 플러그인이다.

6-1. IniAdminPlugin 설치

http://trac-hacks.org/wiki/IniAdminPlugin에서 iniadminplugin_0.11-r5728.zip 파일을 다운로드 한 후, 압축을 해제한다. 압축이 해제된 디렉터리에서 다음을 실행하여 IniAdmin 플러그인을 설치한 후, 아파치를 재시작한다.

# python setup.py install
# /etc/init.d/apache2 restart

그런 다음 Trac 프로젝트 사이트(여기서는 http://pcandme.net:8080/trac/test)의 'Admin' 메뉴 페이지 내 'General' 카테고리의 하위 메뉴인 'Plugin' 메뉴에서 'IniAdmin 0.2' 플러그인을 활성화한다. IniAdmin 플러그인이 활성화 되면 Admin 메뉴 페이지에서 좌측 메뉴에 'trac.ini' 카테고리가 추가 된다.

6-2. AccountManagerPlugin 설치

http://trac-hacks.org/wiki/AccountManagerPlugin에서 accountmanagerplugin_0.11-r5728.zip 파일을 다운로드 한 뒤, 압축을 해제한다. 압축이 해제된 디렉터리에서 다음을 실행하여 AccountManager 플러그인을 설치한 후, 아파치를 재시작한다.

# python setup.py install
# /etc/init.d/apache2 restart

그런 다음 Trac 프로젝트 사이트의 'Admin' 메뉴 페이지 내 'General' 카테고리의 하위 메뉴인 'Plugin' 메뉴에서 'TracAccountManager 0.2.1dev' 플러그인의 컴포넌트 중 다음만을 활성화한다.

AccountManagerAdminPage, AccountManager, HtPasswdStore, AccountModule

또한 추가된 'Accounts' 카테고리의 'Configuration' 메뉴에서 다음과 같이 Trac 접속 계정 정보 파일을 설정해 준다.

/var/lib/htpasswd/htpasswd

Accounts 카테고리의 'Users' 메뉴를 누르면 원래 계정 리스트를 볼 수 있고 추가, 수정, 삭제 가능하여야 하는데, 나의 경우, 다음과 같은 에러가 만났다.

This password store does not support listing users

이 에러는 trac.ini 파일에서 다음과 같이 [account-manager] 섹션을 직접 수정하여 해결 하였다.

# vi /var/lib/trac/test/conf/trac.ini

(전략)
...
[account-manager]
force_passwd_change = true
password_file = /var/lib/htpasswd/htpasswd
password_store = HtPasswdStore
...
(후략)

위에서 볼드체로 쓰여져 있는 것이 추가된 것이다.

6-3. TimingAndEstimationPlugin 설치

http://trac-hacks.org/wiki/TimingAndEstimationPlugin에서 timingandestimationplugin_branches_trac0.11-r5729.zip 파일을 다운로드 한 뒤, 압축을 해제한다. 압축이 해제된 디렉터리에서 다음을 실행하여 TimingAndEstimation 플러그인을 설치한 후, 아파치를 재시작한다.

# python setup.py install
# /etc/init.d/apache2 restart

그런 다음 Trac 프로젝트 사이트의 'Admin' 메뉴 페이지 내 'General' 카테고리의 하위 메뉴인 'Plugin' 메뉴에서 'timingandestimationplugin 0.7.8' 플러그인의 모든 컴포넌트를 활성화한다. 이 때, 적용 버튼을 누르면 다음의 에러가 발생 할 수도 있는데,

Trac Error

TracError: The Trac Environment needs to be upgraded.

Run "trac-admin /var/lib/trac/sim_portal upgrade"

이 때에 다음을 실행하여 데이터베이스 스키마를 업그레이드시켜 주면 해결된다.

# trac-admin /var/lib/trac/sim_portal upgrade

Timing and Estimation needs an upgrade
Upgrading Database
Creating bill_date table
Creating report_version table
Upgrading report_version table to v4
Dropping report_version table
Upgrading reports
Upgrading fields
Upgrading usermanual
Done Upgrading
Upgrade done.

아파치를 재시작하고, 에러 메시지가 출력된 페이지를 새로 고침 한다.

# /etc/init.d/apache2 restart

Trac 프로젝트 사이트에 'Management' 탭이 추가 되어 있으면 설치가 된 것이다.

* 참고
- http://blog.daum.net/kuh74/7583052
- http://trac.edgewall.org/wiki/TracInstall
- http://trac.edgewall.org/wiki/TracOnDebian
- http://goodbbai.tistory.com/29
- http://programmers-blog.com/2009/04/09/trac-password-store-problem
- http://trac-hacks.org/wiki/AccountManagerPlugin
- http://trac-hacks.org/wiki/AccountManagerPlugin
- http://trac-hacks.org/wiki/TimingAndEstimationPlugin
- 자바 프로젝트 필수 유틸리티, 박재성, 한빛미디어(주), 2009

** 추가 **
설치를 완료한 후, Trac 프로젝트 목록 페이지(여기서는 http://localhost:8080/trac)를 보면 추가한 프로젝트 외에 다음과 같은 이상한 것이 보일 수도 있다.

.egg-cache: Error
([Errno 2] No such file or directory: '/var/lib/trac/.egg-cache/VERSION')


'.egg-cache' 디렉터리는 실제로 Trac 프로젝트 디렉터리 상에 존재하는 것으로, 캐쉬에 관한 데이터를 가지고 있을 것으로 추정된다. 이는 Trac 버전 0.11.1에서의 버그로, 0.11.2에서는 이 버그가 고쳐진다고 한다.

** 추가 2 **
'4. 웹 서버(아파치) 연동'에서 8080 포트로 Trac 프로젝트 사이트가 서비스 되도록 가상 호스트 설정을 해주었는데, 이럴 필요 없이 그냥 80 포트로 서비스 되도록 Trac 프로젝트 사이트의 위치만 설정해 주어도 된다.;

/etc/apache2/conf.d에 'trac.conf'라는 파일을 만들고 아래의 내용을 넣어 준다.

<Location /trac>
    SetHandler mod_python
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnvParentDir /var/lib/trac
    PythonOption TracUriRoot /trac
</Location>

<LocationMatch "/trac/[^/]+/login">
    AuthType Basic
    AuthName "Trac, Issue Tracking and Documenting"
    AuthUserFile /var/lib/htpasswd/htpasswd
    Require valid-user
</LocationMatch>


아파치를 재시작하기 전에 /etc/apache2/sites-enabled 디렉터리에 추가되었던 가상 호스트 설정을 'a2dissite' 명령으로 해제 한다. 물론 이는 'unlink' 명령어 등으로 심볼릭 링크를 바로 제거해도 된다.

이제 다음처럼 아파치를 재시작하면 자동으로 conf.d 디렉터리 내의 설정 파일들이 로드되면서 Trac 프로젝트 사이트의 위치를 추가해준다.

# /etc/init.d/apache2 restart


이제, 포트 번호를 넣지 않고(80포트가 디폴트이므로), 다음과 같은 주소로 Trac 프로젝트 사이트 목록 페이지에 접근 가능해 진다.

http://localhost/trac

Posted by pcandme

TRACKBACK http://pcandme.net/trackback/64 관련글 쓰기

댓글을 달아 주세요