Centos7 下yum安装http+svn
2019-02-22 本文已影响0人
林亚希
安装
yum update
yum install httpd
yum install mod_dav_svn
yum install subversion
验证安装
[root@localhost ~]# httpd -version
Server version: Apache/2.4.6 (CentOS)
Server built: Nov 5 2018 01:47:09
[root@localhost ~]# svnserve --version
svnserve,版本 1.7.14 (r1542130)
编译于 Apr 11 2018,02:40:28
版权所有 (C) 2013 Apache 软件基金会。
此软件包含了许多人的贡献,请查看文件 NOTICE 以获得更多信息。
Subversion 是开放源代码软件,请参阅 http://subversion.apache.org/ 站点。
下列版本库后端(FS) 模块可用:
* fs_base : 模块只能操作BDB版本库。
* fs_fs : 模块与文本文件(FSFS)版本库一起工作。
Cyrus SASL 认证可用。
创建仓库
[root@localhost ~]# cd /home/
[root@localhost home]# mkdir svn
[root@localhost home]# cd svn
[root@localhost svn]# svnadmin create esbs
[root@localhost svn]# chown -R apache:apache esbs/
[root@localhost svn]# ll
总用量 0
drwxr-xr-x 6 apache apache 86 2月 22 15:56 esbs
创建验证信息
[root@localhost svn]# cd esbs/
[root@localhost esbs]# cp conf/authz ../
[root@localhost esbs]# cd ..
[root@localhost svn]# touch passwd
生成账号
htpasswd /home/svn/passwd linyuchi
权限管理设置
修改authz配置
[groups]
admin=linyuchi
将svn关联到apache上
vi /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.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 'httpd_sys_content_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 httpd_sys_content_t stuff
#
#<Location /repos>
# DAV svn
# SVNParentPath /var/www/svn
#
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
# AuthType Basic
# AuthName "Authorization Realm"
# AuthUserFile /path/to/passwdfile
# Require valid-user
# </LimitExcept>
#</Location>
<Location /esbs>
DAV svn
SVNParentPath /home/svn
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
AuthType Basic
AuthName "Authorization SVN"
AuthzSVNAccessFile /home/svn/authz
AuthUserFile /home/svn/passwd
Require valid-user
# </LimitExcept>
</Location>
重启httpd
service httpd restart
测试
在浏览器中输入http://ip或网站/esbs/esbs