我打算在CentOS 5.8(CentOS 5.8版(最終版))上安裝Subversion服務器。我只有CentOS的一點經驗。到目前爲止,我只與SuSE和Ubuntu一起工作過。CentOS 5.8上的SVN服務器
我遇到的問題是,當我嘗試通過http://domain.tld/svn訪問我的SVN存儲庫時,我得到「Forbidden,您無權訪問此服務器上的/ svn /。」。
這些是我的設置步驟:/etc/httpd/conf.d/subversion.conf的
yum install mod_dav_svn subversion
內容
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /var/www/svn
</Location>
創建相關的路徑
mkdir -p /var/www/svn && cd /var/www/svn
svnadmin create repos
chown -R apache:apache repos
service httpd restart
我不知道,什麼是錯的...
個在CentOS 5.7的其他來源建議將此作爲一個額外的步驟:
chcon -R -t httpd_sys_content_t /var/www/svn/repos
chcon -R -t httpd_sys_rw_content_t /var/www/svn/repos
當我執行,我得到chcon: can't apply partial context to unlabeled file /var/www/svn/repos
所以我環顧四周,發現一個用戶說,我應該使用
chcon -h system_u:object_r:httpd_sys_content_t /var/www/svn/repos
chcon -R -h apache:object_r:httpd_sys_content_t /var/www/svn/repos/*
代替
chcon -R -t httpd_sys_content_t /var/www/svn/repos
所以我的廣告DED還2線httpd_sys_rw_content_t
:
chcon -h system_u:object_r:httpd_sys_content_t /var/www/svn/repos
chcon -R -h apache:object_r:httpd_sys_content_t /var/www/svn/repos/*
chcon -h system_u:object_r:httpd_sys_rw_content_t /var/www/svn/repos
chcon -R -h apache:object_r:httpd_sys_rw_content_t /var/www/svn/repos/*
問題仍然存在......
service httpd restart
問題仍然存在......
編輯
我也開始加入認證規則的subversion.conf:
<LimitExcept GET PROPFIND OPTIONS REPORT>
AuthzSVNAccessFile /etc/subversion/svn-access
# Require SSL connection for password protection.
# SSLRequireSSL
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /etc/subversion/svn-passwd
Require valid-user
</LimitExcept>
這些配置規則是從SuSE下的先前正在運行的安裝中複製的。這些文件具有有效的內容。問題仍然存在......
編輯
我已刪除了<LimitExcept GET PROPFIND OPTIONS REPORT>
和</LimitExcept>
線,使認證始終適用。當我現在從瀏覽器訪問svn時,我得到一個HTTP-Basic-Auth窗口。輸入現有和正確的憑證後,「禁止」消息再次出現。問題仍然存在...
編輯
我終於得到它運行。我已通過SVNPath /var/www/svn/repos
而不是SVNParentPath /var/www/svn
設置存儲庫路徑。現在一切都很好...
如果您嘗試訪問'HTTP會發生什麼:\\使用domain.tld \ SVN \ repos'? – madth3 2012-07-22 15:01:20
紫禁城,您沒有權限在此服務器上訪問/ SVN /回購。 – Ron 2012-07-22 15:14:03
日誌文件中的任何內容? – Matteo 2012-07-22 16:03:44