日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

Fedora 11 上安装subversion 和apache服务器

發布時間:2025/3/21 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Fedora 11 上安装subversion 和apache服务器 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

轉載請注明出處 http://blog.csdn.net/sunxinrui1983/archive/2009/09/15/4554694.aspx

一、需要安裝數據包

?

?? #yum install apr

?? #yum install mod_dav_svn

?

二、配置apache服務器

? 配置apache服務器,使其加載subversion模塊。

在/etc/httpd/conf.d/下看看能否找到subversion.conf,如果沒有,按照下面內容建立該文件

?

LoadModule dav_svn_module???? modules/mod_dav_svn.so
LoadModule authz_svn_module?? modules/mod_authz_svn.so
#LoadModule dav_module modules/mod_dav.so

#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn".? Each repository
# must be both:
#
#?? a) readable and writable by the 'apache' user, and
#
#?? b) labelled with the 'http_sys_content_rw_t' context if using
#?? SELinux
#

#
# To create a new repository "http://localhost/repos/stuff" using
# this configuration, run as root:
#
#?? # cd /var/www/svn
#?? # svnadmin create stuff??
#?? # chown -R apache.apache stuff
#?? # chcon -R -t -t http_sys_content_rw_t stuff
#

<Location /repos>
???? DAV svn
???? SVNParentPath /public/svn/
#
#?? # Limit write permission to list of valid users.
#?? <LimitExcept GET PROPFIND OPTIONS REPORT>
#????? # Require SSL connection for password protection.
#????? # SSLRequireSSL
#
????? AuthzSVNAccessFile /etc/httpd/authz.conf
????? AuthType Basic
????? AuthName "Please enter your name and password"
????? AuthUserFile /etc/httpd/conf.d/authfile
????? Require valid-user
#?? </LimitExcept>
</Location>

?

其中:

SVNParentPath指明svn數據庫的路徑,如果有多個項目,則指向多個項目的父目錄,用戶可以通過http://ip_addr/repos/project_1來訪問。

AuthUserFile指明http訪問用戶名,密碼驗證文件路徑,如果不設置用戶名,密碼則該部分可以注釋掉。添加用戶用如下命令:

htpasswd -c /etc/httpd/conf.d/authfile sxr

-c表示創建,以后添加則不需此參數。

AuthzSVNAccessFile 指明詳細權限設置文件路徑,該文件可以進一步指明不同項目的訪問權限,該文件的格式如下(需要注意每行前面不能有空格 ):

[groups]
sxr = sxr
stb_sxr = stb_sxr

[AR6k:/]
sxr = rw

[linux-2.6.30:/]
stb_sxr = rw

三、重新啟動apache服務

#apachectl restart

?

附錄:設置subversion庫

用如下命令創建subversion管理庫

#mkdir /public/svn/AR6k

#svnadmin create /public/svn/AR6k

參考如下內容編輯配置文件

#cat /public/svn/AR6k/conf/svnserve.conf

?

### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.? (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[general]
### These options control access to the repository for unauthenticated
### and authenticated users.? Valid values are "write", "read",
### and "none".? The sample settings below are the defaults.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file.? Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.? Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.? If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.? The default realm
### is repository's uuid.
# realm = My First Repository

?

?

導入工程文件

#svn import AR6k files:///public/svn/AR6k -m "original"

?

如果想直接使用subversion提供的簡單服務器,可以參考示例配置以下兩個文件

????? #vi /public/svn/AR6k/conf/authz

### This file is an example authorization file for svnserve.


[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
sxr = sxr
cvs = cvsroot

[repository:/public/svn/AR6k]
?@sxr = rw
# @harry_and_sally = rw
# * = r
[AR6k:/]
@sxr = rw
@cvs = rw

其中@sxr表示sxr組

?

#vi /public/svn/AR6k/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
sxr = sxr
cvsroot = cvsroot

?

啟動subversion服務器

#svnserve -d -r /public/svn/

?

然后就可以通過svn://ip_addr/AR6k 來訪問代碼庫。

?

?

?

?

總結

以上是生活随笔為你收集整理的Fedora 11 上安装subversion 和apache服务器的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。