#安装svn和apache yum install -y subversion httpd mod_dav_svn
#创建仓库 mkdir -p /opt/java/repos
cd /opt/java/repos
svnadmin create hello-world
mkdir -p /data/svn
#配置svn 进入 cd /opt/java/repos/hello-world/conf
这里将passwd(用户文件)和authz(权限文件)拷贝到/data/svn下并命名成svn_passwd和svn_authz
修改/opt/java/repos/hello-world/conf下的svnserve.conf文件
修改/data/svn/svn_passwd文件
修改/data/svn/svn_authz
#启动svn svnserve -d -r /opt/java/repos #端口默认3690
#访问SVN svn://192.168.111.131/hello-world 修改配置文件/etc/httpd/conf.d/subversion.conf(没有则新建),內容为:
<Location /svn>
DAV svn
SVNParentPath /opt/java/repos
AuthType Basic
AuthName "Authorization SVN"
AuthzSVNAccessFile /data/svn/http_authz
AuthUserFile /data/svn/http_passwd
Require valid-user
</Location> 12复制authz 到/data/svn/下 名称为http_authz
cp /opt/java/repos/hello-world/conf/authz /data/svn/http_authz
修改http_authz
13 创建用户文件http_passwd
htpasswd -bc /data/svn/http_passwd admin admin(第一次 加-bc)
htpasswd -b /data/svn/http_passwd zhaojianguo 123456
14:启动apache
systemctl start httpd
让apache用户对”/opt/java/repos/″目录拥有写权限。(之前用的root用户操作的,如下操作直接复制来)
#将用户apache加入root组 usermod -a -G root apache #让group对/opt/java/repos目录也有写权限 chmod -R g+w /opt/java/repos/ 11.http访问svn http://192.168.111.131/svn/hello-world
|