Apache 소스 설치를 했다면, HTTP 서비스를 하기 위해서는 Subversion 역시 소스 설치를 해야 합니다.
1. 설치 전 준비
최신버전의 Sqlite 와 Berkeley DB 가 필요합니다. yum으로 보통 설치가 되어 있지만 최신이 아니라 에러를 발생합니다.
Sqlite 는 sqlite3.c 파일만 subversion 설치 디렉토리에 복사하면 되며,
Berkeley DB 는 파일시스템으로 사용할게 아니라면 configure 옵션으로 설치시 제외할 수 있습니다.
HTTP 서비스에는 DAV 모듈이 필요하므로, Apache 설치시 --enable-dav 옵션이 없었다면 Apache 도 재설치를 해야 합니다.
2. 다운로드 / 설치
# cd /usr/local/src
# wget http://mirror.khlug.org/apache/subversion/subversion-1.7.1.tar.gz
# tar zxvf subversion-1.7.1.tar.gz
# wget http://www.sqlite.org/sqlite-amalgamation-3070900.zip
# unzip sqlite-amalgamation-3070900.zip
# mkdir -p subversion-1.7.1/sqlite-amalgamation
# cp -r sqlite-amalgamation-3070900/sqlite3.c subversion-1.7.1/sqlite-amalgamation/
# cd subversion-1.7.1
# ./configure --prefix=/usr/local/subversion \
--with-apr=/usr/local/httpd/bin/apr-1-config \
--with-apr-util=/usr/local/httpd/bin/apu-1-config \
--with-apxs=/usr/local/httpd/bin/apxs \
--without-berkeley-db
# make
# make install
# wget http://mirror.khlug.org/apache/subversion/subversion-1.7.1.tar.gz
# tar zxvf subversion-1.7.1.tar.gz
# wget http://www.sqlite.org/sqlite-amalgamation-3070900.zip
# unzip sqlite-amalgamation-3070900.zip
# mkdir -p subversion-1.7.1/sqlite-amalgamation
# cp -r sqlite-amalgamation-3070900/sqlite3.c subversion-1.7.1/sqlite-amalgamation/
# cd subversion-1.7.1
# ./configure --prefix=/usr/local/subversion \
--with-apr=/usr/local/httpd/bin/apr-1-config \
--with-apr-util=/usr/local/httpd/bin/apu-1-config \
--with-apxs=/usr/local/httpd/bin/apxs \
--without-berkeley-db
# make
# make install
3. .bash_profile 수정
# vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/subversion/bin
SVN_EDITOR=/usr/bin/vim
export SVN_EDITOR
# source ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/subversion/bin
SVN_EDITOR=/usr/bin/vim
export SVN_EDITOR
# source ~/.bash_profile
4. 저장소 생성
# mkdir -p /home/svn/oops4u
# svnadmin create --fs-type fsfs /home/svn/oops4u
# svnadmin create --fs-type fsfs /home/svn/oops4u
5. svn 사용자 인증 설정
# vi /home/svn/oops4u/conf/svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = passwd
realm = Oops4u Repository!
# vi /home/svn/oops4u/conf/passwd
[users]
username = password
[general]
anon-access = none
auth-access = write
password-db = passwd
realm = Oops4u Repository!
# vi /home/svn/oops4u/conf/passwd
[users]
username = password
6. http 사용자 인증 설정
# htpasswd -c /home/svn/oops4u/conf/.htpasswd username
New password:
Re-type new password:
# vi /usr/local/httpd/conf/extra/httpd-svn.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /www1>
DAV svn
SVNPath /home/svn/www1
AuthType Basic
AuthName "Sample Repository!"
AuthUserFile /home/svn/oops4u/conf/.htpasswd
Require valid-user
</Location>
# vi /usr/local/httpd/conf/httpd.conf
Include conf/extra/httpd-svn.conf
New password:
Re-type new password:
# vi /usr/local/httpd/conf/extra/httpd-svn.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /www1>
DAV svn
SVNPath /home/svn/www1
AuthType Basic
AuthName "Sample Repository!"
AuthUserFile /home/svn/oops4u/conf/.htpasswd
Require valid-user
</Location>
# vi /usr/local/httpd/conf/httpd.conf
Include conf/extra/httpd-svn.conf
* htpasswd -c 옵션은 파일을 생성하는 옵션이므로 사용자를 추가할때는 생략해야 함.
7. 데몬 실행
# svnserve -d -r /home/svn/
# /etc/init.d/httpd restart
# vi /etc/rc.local
/usr/local/subversion/bin/svnserve -d -r /home/svn/
# /etc/init.d/httpd restart
# vi /etc/rc.local
/usr/local/subversion/bin/svnserve -d -r /home/svn/
WRITTEN BY
- 손가락귀신
정신 못차리면, 벌 받는다.
,