apache+svn服务器搭建
Apache + SVN服务器搭建
操作系统:CentOS Linux release 7.7.1908
svn:1.7.14
apache:2.4.6
第一步:安装svn
运行以下命令安装SVN
yum install subversion -y
运行以下命令查看SVN版本
svnserve --version
第二步:安装Apache
运行以下命令安装httpd
yum install httpd -y
运行以下命令查看httpd版本
httpd -version
第三步:安装mod_dav_svn
运行以下命令安装mod_dav_svn
yum install mod_dav_svn -y
第四步:配置svn
创建版本库
mkdir /var/svn
cd /var/svn
svnadmin create /var/svn/svnrepos
运行以下命令增加SVN版本库的用户和密码
htpasswd -c /var/svn/svn-auth test
# -c是如果svn-auth文件不存在就创建新的
htpasswd /var/svn/svn-auth test1 # 追加新用户
配置读写权限
# 将刚刚创建的版本库中的conf/authz 拷贝到svn下
cp /var/svn/svnrepos/conf/authz /var/svn/authz
# 运行vim authz命令,打开权限控制文件
vim /var/svn/authz
# 添加一下配置
[svnrepos:/] # 仓库名:路径
test=rw
第五步:配置apache
运行以下命令新增并编辑httpd配置文件
vim /etc/httpd/conf.d/subversion.conf
输入以下配置信息:
<Location /svn>
DAV svn
SVNParentPath /var/svn/
AuthType Basic
AuthName "Authorization SVN"
AuthzSVNAccessFile /var/svn/authz
AuthUserFile /var/svn/svn-auth
Require valid-user
</Location>
# 操作日志记录
CustomLog logs/svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTION
运行以下命令启动Apache服务
systemctl start httpd.service
最后就可以用浏览器访问测试一下咯
# http://<ECS实例公网IP>/svn/<SVN版本库名>
http://192.168.153.32/svn/svnrepos/
结果不如人意
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
经过一系列的查阅资料
chcon -R -t httpd_sys_content_rw_t /var/svn/

浙公网安备 33010602011771号