이 글은 Ubuntu 9.04 를 기준으로 작성했습니다.
1. 패키지 설치
apt-get install trac libapache2-mod-python libapache2-svn
우분투가 알아서 trac,svn 및 apache2, python 등 기본 패키지를 함께 설치 합니다.
2. SVN Repository 생성
svnadmin create /opt/prj-repo/svn/TestProject
3. Trac Project 생성
trac-admin /opt/prj-repo/svn/TestProject initenv
프로젝트명과 저장소 타입등 몇가지 물어보는데, 연동하려는 SVN Repository 경로를 잘 입력합니다.
Creating a new Trac environment at /opt/prj-repo/trac/TestProject
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]> TestProject
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]> 엔터키
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]> 엔터키
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]> /opt/prj-repo/svn/TestProject
Creating and Initializing Project
Installing default wiki pages
TracQuery imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracQuery
TracBackup imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracBackup
SandBox imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/SandBox
WikiPageNames imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiPageNames
TracIni imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracIni
WikiNewPage imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiNewPage
WikiRestructuredTextLinks imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiRestructuredTextLinks
TracSearch imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracSearch
WikiStart imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiStart
TracAccessibility imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracAccessibility
CamelCase imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/CamelCase
TracInstall imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracInstall
TracWorkflow imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracWorkflow
WikiMacros imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiMacros
TracSupport imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracSupport
TracRoadmap imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracRoadmap
TracEnvironment imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracEnvironment
InterTrac imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/InterTrac
TracAdmin imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracAdmin
TitleIndex imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TitleIndex
TracFineGrainedPermissions imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracFineGrainedPermissions
TracSyntaxColoring imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracSyntaxColoring
TracRss imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracRss
TracTickets imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracTickets
TracReports imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracReports
TracNotification imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracNotification
TracLinks imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracLinks
TracTimeline imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracTimeline
TracFastCgi imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracFastCgi
TracImport imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracImport
TracModPython imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracModPython
WikiRestructuredText imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiRestructuredText
TracChangeset imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracChangeset
TracNavigation imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracNavigation
TracUpgrade imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracUpgrade
TracTicketsCustomFields imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracTicketsCustomFields
WikiFormatting imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiFormatting
TracInterfaceCustomization imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracInterfaceCustomization
RecentChanges imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/RecentChanges
TracLogging imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracLogging
TracPermissions imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracPermissions
TracGuide imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracGuide
TracWiki imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracWiki
TracRevisionLog imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracRevisionLog
WikiProcessors imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiProcessors
TracCgi imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracCgi
InterWiki imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/InterWiki
WikiDeletePage imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiDeletePage
TracPlugins imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracPlugins
WikiHtml imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/WikiHtml
InterMapTxt imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/InterMapTxt
TracBrowser imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracBrowser
PageTemplates imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/PageTemplates
TracUnicode imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracUnicode
TracStandalone imported from /usr/lib/python2.6/dist-packages/trac/wiki/default-pages/TracStandalone
/var/lib/python-support/python2.6/svn/fs.py:27: DeprecationWarning: The popen2 module is deprecated. Use the subprocess module.
import sys as _sys, os as _os, popen2 as _popen2, tempfile as _tempfile
Indexing repository
[36]
---------------------------------------------------------------------
Project environment for 'teleweb2.0' created.
You may now configure the environment by editing the file:
/opt/prj-repo/trac/TestProject/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 /opt/prj-repo/trac/TestProject
Then point your browser to http://localhost:8000/TestProject.
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!
4. Apache2 연동
vi /etc/apache2/site-available/default
svn과 trac을 apache와 연동시키기 위한 환경설정, passwd 파일을 공유하여 동일한계정이 사용되도록 합니다.
접속 경로는 http://localhost/svn/저장소명 , http://localhost/trac/ 프로젝트명 으로 설정 합니다.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
<Location /svn>
DAV svn
SVNParentPath /opt/prj-repo/svn
AuthType Basic
AuthName "SVN Repository"
AuthUserFile /opt/prj-repo/htpasswd
Require valid-user
</Location>
<Location /trac>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/prj-repo/trac
PythonOption TracUriRoot /trac
</Location>
<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "Trac Project"
AuthUserFile /opt/prj-repo/htpasswd
Require valid-user
</LocationMatch>
</VirtualHost>
아파치 사이트 재설정 합니다.
a2dissite default;a2ensite default
svn과 trac의 저장소 및 프로젝트들이 웹사이트에서 읽기가 가능하도록 권한을 www-data로 모두 변경 합니다.
※ 저장소가 추가되거나 프로젝트가 추가가되면 필수사항
chown -R www-data:www-data /opt/prj-repo/svn
chown -R www-data:www-data /opt/prj-repo/trac
svn과 trac의 계정 패스워드 파일 생성 합니다.
htpasswd -cm /opt/prj-repo/htpasswd admin (:계정명)
New password: ********
Re-type new password: ********
Adding password for user admin
Apache2 프로세스 재시작 합니다.
/etc/init.d/apache2 restart
5. 테스트
http://localhost/svn/ 저장소 or http://localhost/trac/ 프로젝트 로 접속하여 제대로 올라왔는지 확인 합니다.
접속테스트가 잘된다면 이클립스에서도 위 svn이나 trac으로 접속 테스트 합니다.
'Dev Tool' 카테고리의 다른 글
Tomcat 과 Eclipse 연동 (0) | 2011.01.19 |
---|---|
Trac 저장소 복사 (0) | 2009.09.05 |
Subversion 저장소 백업 및 복원 (0) | 2009.09.04 |