SVN Server安裝部署攻略(Linux+SubVersion+Apache)__Linux

來源:互聯網
上載者:User
一.  安裝apr依賴庫(Apache Portable Runtime Module)

http://apache.mirror.phpchina.com/apr/apr-1.2.11.tar.gz
./configure
make
make install

http://apache.mirror.phpchina.com/apr/apr-util-1.2.10.tar.gz
./configure --with-apr=/home/chenmin/apr-1.2.11
make
make install

二. 重新編譯httpd

檢查已安裝的 Apache2 是否已經安裝了 mod_dav .

如果已經成功安裝了Apache,使用 httpd -M 來查看有沒有安裝 dav_module,如果沒有的話 必須附加 ‘–enable-dav’ ‘–enable-dav-fs’ 兩個參數重新編譯 Apache,否則即使編譯通過了svn,apache也會啟動不起來.

wget http://apache.mirror.phpchina.com/httpd/httpd-2.2.6.tar.gz
./configure --enable-dav --enable-dav-fs
make
make install

三. 安裝subversion

最新的版本 Subversion 可以在這裡找到 :http://subversion.tigris.org/project_packages.html
http://subversion.tigris.org/downloads/subversion-1.4.5.tar.gz

下載neon庫,使svn支援webdav, https加密的連結.
下載之後放到subversion安裝目錄下,並重新命名即可, subversion會自動監測並配置, 目前只支援 0.25.5.

;cd subversion-SVN-LAST-VERSION-DIR
cd subversion-1.4.5
wget http://www.webdav.org/neon/neon-0.25.5.tar.gz
tar xzf neon-0.25.5.tar.gz
mv neon-0.25.5 neon

./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/home/chenmin/apr-1.2.11 --with-apr-util=/home/chenmin/apr-util-1.2.10 --with-ssl

由於沒有安裝Berkeley DB,所以使用FSFS
make
sudo make install

四.  配置subversion和apache

拷貝svn模組到apache模組目錄下
cp /data/subversion-1.4.5/subversion/mod_dav_svn/.libs/mod_dav_svn.so /usr/local/apache2/modules/
cp /data/subversion-1.4.5/subversion/mod_authz_svn/.libs/mod_authz_svn.so /usr/local/apache2/modules/

編輯httpd.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<Location /svn>
DAV svn
SVNParentPath /data/svn
</Location>

運行htpasswd添加使用者和密碼
/usr/local/apache2/bin/htpasswd -cm /data/svn/svn-auth-file chenmin
/usr/local/apache2/bin/htpasswd -m /data/svn/svn-auth-file admin

再次編輯httpd.conf
<Location /svn>
DAV svn
SVNParentPath /data/svn
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /data/svn/svn-auth-file
Require valid-user
AuthzSVNAccessFile /data/svn/svn-access-file
</Location>

其中svn-auth-file是認證檔案,儲存使用者名稱和密碼,svn-access-file是存取權限檔案,規定各個目錄的訪問者的許可權, 樣本的許可權分配的檔案的格式如下。
[groups]
admin = john, kate
devteam1 = john, rachel, sally
devteam2 = kate, peter, mark
docs = bob, jane, mike
training = zak
# Default access rule for ALL repositories
# Everyone can read, admins can write, Dan German is excluded.
[/]
* = r
@admin = rw
dangerman =
# Allow developers complete access to their project repos
[proj1:/]
@devteam1 = rw
[proj2:/]
@devteam2 = rw
[bigproj:/]
@devteam1 = rw
@devteam2 = rw
trevor = rw
# Give the doc people write access to all the docs folders
[/trunk/doc]
@docs = rw
# Give trainees write access in the training repository only
[TrainingRepos:/]
@training = rw
許可權設定檔中,關鍵的幾個概念是:目標和許可權,也就是為誰分配什麼樣的許可權。讀為r,寫為w,如果沒有許可權那麼什麼也不寫即可。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.