安装Apache2.4[httpd]
yum install httpd
启动httpd并设置开机启动
systemctl enable httpd.service
systemctl start httpd.service
在防火墙中开放80端口
firewall-cmd --add-port=80/tcp
firewall-cmd --permanent --add-port=80/tcp
打开浏览器输入IP能看到欢迎页即一切正常
安装subversion
下载subversion 的rpm包:http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/x86_64/ 需要的文件:
libserf-1.3.-1.el7.x86_64.rpm
serf-1.3.-1.x86_64.rpm
subversion-1.9.-1.x86_64.rpm
subversion-tools-1.9.-1.x86_64.rpm
mod_dav_svn-1.9.*-1.x86_64.rpm
依次安装:
yum install libserf-1.3.8-1.el7.x86_64.rpm
yum install serf-1.3.8-1.x86_64.rpm
yum install subversion-1.9.7-1.x86_64.rpm
yum install subversion-tools-1.9.7-1.x86_64.rpm
yum install mod_dav_svn-1.9.7-1.x86_64.rpm
注意安装顺序,被依赖的软件要先安装
建立版本库
mkdir /opt/repository/maven
cd /opt/repository/maven
svnadmin create webcode
创建用户及配置授权文件 创建用户
htpasswd -c /etc/httpd/passwd username
配置授权文件
vim /etc/httpd/authz
[aliases]
[groups]
admin = username
[webcode:/]
@ admin = rw
在Apache中配置subversion
vim /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNListParentPath on
SVNParentPath /opt/repository/maven/
#SVNPath /opt/repository/maven/
AuthType Basic
AuthName "Authorization"
AuthUserFile /etc/httpd/passwd
AuthzSVNAccessFile /etc/httpd/authz
Require valid-user
</Location>
设置版本库文件所有者及权限
chown -R apache.apache /opt/repository/maven/
chcon -R -t httpd_sys_content_t /opt/repository/maven/
chcon -R -u system_u /opt/repository/maven/
重启httpd服务
systemctl restart httpd.service
如果一切正常到此就可以正常使用了,使用http://127.0.0.1/svn/webcode检出版本库即可