zoukankan      html  css  js  c++  java
  • centos7使用Apache实现HTTP访问SVN资源库

    本文参考自:https://www.linuxidc.com/Linux/2018-04/151881.htm

          https://blog.csdn.net/Jiaozi_jyj/article/details/84592574

    一、环境准备:

    1.centos7系统

    2.以安装好svn 点击查看

    二、安装

    1、安装apache

    yum install httpd

    2、安装mod_dav_svn

    yum install mod_dav_svn

    3、创建http访问用户

    格式如下,其用户名和密码与svn用户名和密码一致:

    htpasswd [-cmdpsD] passwordfile username

    htpasswd -cm /home/svn/http_passwd panql

    可将创建用户zhangyj,接着输入密码并确认。

    注:创建第二或之后的用户时,一定不能用参数“ c ”,否则之前的用户就会被删除,示例如下:

    htpasswd -m /home/svn/http_passwd panql

    删除用户命令:

    htpasswd -D passwd panql

    4、创建Apache配置文件

    vim /etc/httpd/conf.d/subversion.conf

    内容如下:

    <Location /svn> 
    DAV svn 
    SVNParentPath /home/svn/svnrepos
    AuthType Basic 
    AuthName "SVN Repository" 
    AuthUserFile /home/svn/http_passwd 
    Require valid-user 
    </Location>

    解释:

    SVNParentPath:资源库目录路径
    AuthUserFile:第3步创建的用户密码文件路径

    5、修改资源库目录所有者为apache

    chown apache:apache /home/svn -R

    6、重启apache

    systemctl restart httpd.service

    到些安装成功!

    7、测试

    格式:http://ip/svn/资源库名称

    如我创建一个资源库mynote,则链接为:http://127.0.0.1/svn/mynote

    若访问不了报错,查看apace报错日志文件

    [Tue Nov 27 08:46:22.506678 2018] [authz_svn:error] [pid 28288] (13)Permission denied: [client 192.168.31.1:58874] Failed to load the AuthzSVNAccessFile: Can't open file '/var/svn/repo/conf/authz': Permission denied
    [Tue Nov 27 08:46:33.520026 2018] [authn_file:error] [pid 28284] (13)Permission denied: [client 192.168.31.1:58876] AH01620: Could not open password file: /var/svn/repo/conf/http_passwd

    需执行

    chcon -R -t httpd_sys_content_rw_t /home/svn/svnrepos
  • 相关阅读:
    LintCode "Maximum Gap"
    LintCode "Wood Cut"
    LintCode "Expression Evaluation"
    LintCode "Find Peak Element II"
    LintCode "Remove Node in Binary Search Tree"
    LintCode "Delete Digits"
    LintCode "Binary Representation"
    LeetCode "Game of Life"
    LintCode "Coins in a Line"
    LintCode "Word Break"
  • 原文地址:https://www.cnblogs.com/panql341/p/13476928.html
Copyright © 2011-2022 走看看