리눅스 trac 설치

(리눅스 trac 설치하기에서 넘어옴)

1 사전작업[ | ]

Trac을 설치하기 위해서는 다음 4가지가 필요한데, 리눅스를 설치하면 보통 다 설치되어 있다.

한방에 설치하려면...

yum install httpd python sqlite subversion

2 서브버전 설정[ | ]

2.1 SVN 저장소 생성[ | ]

명령어
mkdir /svn
cd /svn
svnadmin create --fs-type fsfs 저장소이름
실행예시
[root@localhost ~]# mkdir /svn
[root@localhost ~]# cd /svn
[root@localhost svn]# svnadmin create --fs-type fsfs repo1

2.2 SVN 계정 등록[ | ]

명령어
vi /svn/저장소이름/conf/passwd

아래와 같은 형식으로 마지막에 계정을 등록한다.

### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
 
[users]
# harry = harryssecret
# sally = sallyssecret
아이디 = 패스워드
실행예시
[root@localhost svn]# vi /svn/repo1/conf/passwd

2.3 SVN 서비스 시작[ | ]

[root@localhost svn]# svnserve -d -r /svn

이제 외부에서 SVN 프로토콜을 통해 SVN을 이용할 수 있다.

3 yum 저장소 확인[ | ]

현재 설정된 yum 저장소에 trac이 있는지 확인해보자. 아마 없을 것이다. (있다면 다음 문단의 yum 저장소 등록 부분은 넘어가도 된다.)

명령어
yum info trac
실행 예시
[root@localhost ~]# yum info trac
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.cdnetworks.com
 * extras: centos.mirror.cdnetworks.com
 * updates: centos.mirror.cdnetworks.com
base                                                     | 1.1 kB     00:00     
extras                                                   | 2.1 kB     00:00     
updates                                                  | 1.9 kB     00:00     
Error: No matching Packages to list

→ 현재 설정된 yum 저장소에는 trac 패키지가 없다.

4 yum 저장소 등록[ | ]

trac을 가진 저장소(RPMforge)를 등록해야 하는데, CPU 아키텍처 방식에 맞는 것을 등록해야 한다.

명령어
uname -i
실행 예시
[root@localhost ~]# uname -i
x86_64

위 결과에 맞게 저장소 중 하나를 선택하여 등록하자.

4.1 i386인 경우[ | ]

명령어
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

4.2 x86_64인 경우[ | ]

명령어
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
실행예시
[root@localhost ~]# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Retrieving http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
warning: /var/tmp/rpm-xfer.tl5YZW: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:rpmforge-release       ########################################### [100%]

5 trac 설치[ | ]

명령어
yum install trac -y
실행예시
[root@localhost ~]# yum install trac -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
... (생략)
Installed:
  trac.noarch 0:0.12-2.el5.rf                                                   

Dependency Installed:
  mod_python.x86_64 0:3.2.8-3.1          python-genshi.noarch 0:0.6-2.el5.rf   
  python-setuptools.noarch 0:0.6c5-2.el5 python-sqlite2.x86_64 0:2.6.3-1.el5.rf

Complete!

6 trac 설정[ | ]

[root@localhost trac]# trac-admin /var/www/trac/jmnote initenv
Creating a new Trac environment at /var/www/trac/jmnote

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]>

프로젝트명 Enter

Project Name [My Project]> jmnote
 
 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

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

Creating and Initializing Project
 Installing default wiki pages
... (생략)
The latest documentation can also always be found on the project
website:

  http://trac.edgewall.org/

Congratulations!

7 아파치 - trac 연동 설정[ | ]

  • trac.conf에 기록된 trac의 위치를 바로잡자.
[root@localhost trac]# vi /etc/httpd/conf.d/trac.conf

(변경 전)

  PythonOption TracEnvParentDir /var/trac

(변경 후)

  PythonOption TracEnvParentDir /var/www/trac

권한 아파치 계정이 trac 폴더를 접근할 수 있게 해주자.

[root@localhost trac]# chown -R apache:apache /var/www/trac/jmnote/

8 아파치 시작[ | ]

[root@localhost trac]# service httpd start
Starting httpd:                                            [  OK  ]
  • http://localhost/trac/ 에 접속하고 거기서 프로젝트명을 클릭하여 들어가면 정상적으로 보일 것이다.

9 같이 보기[ | ]

10 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}