代码版本控制系统有人喜欢用SVN,有人喜欢用GIT
1、环境
os:centos7
apache:2.4.6
python:2.7 --自带
submin2:2.2.1
2、安装apache 等软件
yum install -y mod_dav_svn apr-util-sqlite apr-util
yum install httpd
yum install subversion
yum install -y subversion-python
3、安装submin2
下载并安装
wget http://supermind.nl/submin/current/submin-2.2.1-1.tar.gz && tar xvfz submin-2.2.1-1.tar.gz && cd submin-2.2.1-1 && python2 setup.py install
初始化
submin2-admin /home/svn/submin initenv venic@qq.com
放置配置文件到httpd配置目录
ln -s /home/svn/submin/conf/apache-2.4-svn.conf /etc/httpd/conf.d/
ln -s /home/svn/submin/conf/apache-2.4-webui-cgi.conf /etc/httpd/conf.d/
诊断
submin2-admin /home/svn/submin diagnostics
关闭 git支持
submin2-admin /home/svn/submin config set vcs_plugins svn
修改 httpd相关配置
ServerNmae:good.goluk.cn
三个目录的对应关系如下
DocumentRoot: /home/svn
Location "/svndata"
SVNParentPath /home/svn/svndata
看此方法,只需要在
vi /etc/httpd/conf/httpd.conf
后面添加如下配置即可
配置示例
<Virtualhost *:80>
ServerName submin.venic.dev
DocumentRoot "/home/svn"
#LimitRequestBody 102400000
LimitXMLRequestBody 0
LimitRequestBody 0
#SecRequestBodyAccess Off
</VirtualHost>
<IfModule !mod_authn_dbd.c>
# Nothing should work, so show a page describing this
AliasMatch "^/svn" /usr/lib/python2.7/site-packages/submin/static/www/nomodauthndbd.html
<Location "/svndata">
Require all granted
#LimitRequestBody 102400000
</Location>
</IfModule>
<IfModule mod_dav_svn.c>
<Location "/svndata">
DAV svn
SVNParentPath /home/svn/svndata
AuthType Basic
AuthName "Subversion repository"
# Authentication
AuthBasicProvider dbd
AuthDBDUserPWQuery "SELECT password FROM users WHERE name=%s"
# Authorization
AuthzSVNAccessFile /home/svn/submin/conf/authz
Satisfy Any
Require valid-user
</Location>
</IfModule>
目录权限设置
/svn 下面的目录读写权限要给apache用户
chown -R apache:apache /home/svn
service httpd start