我打算在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