AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 408703
Accepted
mulllhausen
mulllhausen
Asked: 2017-12-05 03:40:54 +0800 CST2017-12-05 03:40:54 +0800 CST 2017-12-05 03:40:54 +0800 CST

带有 apache2 配置路径错误的 SVN

  • 772

我刚刚svn通过 https (with apache2) 进行了配置。我可以svn checkout,但是提交失败了。我可以从apache2日志中看到,svn服务器正在错误的位置查找用于执行提交的存储库。这是我的apache2443.example.com.conf 文件:

<IfModule mod_ssl.c>
    <virtualhost *:443>
    # requests to https://example.com land here
    ServerName example.com
    DocumentRoot /home/me/svn-repos

    # global properties for all directories in this site
    <Location />
        # do not use .htaccess files
        allowoverride none
        #DirectoryIndex index.html
        #require all granted                                                                                    

        DAV svn
        SVNParentPath /home/me/svn-repos
        AuthType Basic
        AuthName "svn repositories"
        AuthUserFile blah.passwd
        #<LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
        #</LimitExcept>
    </Location>

    SSLEngine On
    SSLCertificateFile blah
    SSLCertificateKeyFile blah

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    </FilesMatch>

    ErrorDocument 400 /index.html
    ErrorDocument 401 /index.html
    # lots more ErrorDocument entries

    </virtualhost>
</IfModule>

请注意,我所有的svn存储库都在/home/me/svn-repos(例如/home/me/svn-repos/repo1,,/home/me/svn-repos/repo2等)下的目录中

因此,我查看了我的一个存储库的新本地副本:

$ cd /tmp
$ svn co --username me https://example.com/repo1 repo1
Authentication realm: <https://example.com:443> svn repositories
Password for 'me': ***

A repo1/file1.txt
Checked out revision 1.

到目前为止,一切都很好。但是当我尝试提交时:

$ touch file2.txt
$ svn add file2.txt
A     file2.txt
$ svn ci file2.txt -m added
Authentication realm: <https://example.com:443> svn repositories
Password for 'me': ***

Adding         file2.txt
svn: E175009: Commit failed (details follow):
svn: E175009: The XML response contains invalid XML
svn: E130003: Malformed XML: no element found

我可以从apache2错误日志中看到svn服务器在错误的位置寻找存储库:

$ sudo tail -4 /var/log/apache2/error.log
[Sat Dec 02 20:23:29.626227 2017] [:error] [pid 123] (20014)Internal error (specific information not available): [client x.x.x.x:x] Can't open file '/home/me/svn-repos/index.html/format': Not a directory
[Sat Dec 02 20:23:29.626264 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not fetch resource information.  [404, #0]
[Sat Dec 02 20:23:29.626272 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #20]
[Sat Dec 02 20:23:29.626277 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #20]

它正在寻找的文件是/home/me/svn-repos/repo1/format,但是它没有附加正确的路径才能找到该文件。我怀疑这意味着我需要在我的apache2443.example.com.conf 文件中放一些东西,但我想不出是什么。

更新

我对 443.example.com.conf 文件进行了以下更改:

# ErrorDocument 404 /index.html
ErrorDocument 404 /indexyz.html

现在,当我尝试提交时,错误消息变为:

[Sat Dec 02 20:39:00.153942 2017] [:error] [pid 123] (20014)Internal error (specific information not available): [client 192.168.1.177:50228] Can't open file '/home/me/svn-repos/indexyz.html/format': No such file or directory
[Sat Dec 02 20:39:00.153979 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not fetch resource information.  [404, #0]
[Sat Dec 02 20:39:00.153987 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #2]
[Sat Dec 02 20:39:00.153992 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #2]

但这仍然没有多大帮助。

apache-httpd subversion
  • 2 2 个回答
  • 1588 Views

2 个回答

  • Voted
  1. Lazy Badger
    2017-12-05T04:53:43+08:002017-12-05T04:53:43+08:00
    1. 你犯了所有可能的错误 (3/3)
    2. 你没有读过 SVN 书

    使固定:

    • 存储库不能在 http-tree 内
    • SVN 位置不能在 http-host 的根目录中
    • SVN 位置不能在 http-host 内的物理路径中,只能在逻辑路径中
    • 1
  2. Best Answer
    mulllhausen
    2017-12-07T03:14:11+08:002017-12-07T03:14:11+08:00

    我终于让它工作了。最后它与文档根无关,它是 ErrorDocument 声明 - 我只需要将它们从 更改/index.html为default. 我的最终配置如下所示:

    <IfModule mod_ssl.c>
        <virtualhost *:443>
            # requests to https://example.com land here
            ServerName example.com
            DocumentRoot /home/me/svn-repos
    
            # global properties for all directories in this site
            <Location />
                # do not use .htaccess files
                allowoverride none
    
                DAV svn
                SVNParentPath /home/me/svn-repos
                AuthType Basic
                AuthName "svn repositories"
                AuthUserFile blah.passwd
                Require valid-user
            </Location>
    
            # http://svnbook.red-bean.com/en/1.7/svn.serverconfig.httpd.html
            CustomLog ${APACHE_LOG_DIR}/svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTION
            ErrorLog ${APACHE_LOG_DIR}/error.log
    
            SSLEngine On
            SSLCertificateFile fullchain.pem
            SSLCertificateKeyFile privkey.pem
    
            <FilesMatch "\.(cgi|shtml|phtml|php)$">
                    SSLOptions +StdEnvVars
            </FilesMatch>
    
            ErrorDocument 400 default
            ErrorDocument 401 default
            ErrorDocument 402 default
            ErrorDocument 403 default
            ErrorDocument 404 default
            ErrorDocument 405 default
            ErrorDocument 406 default
            ErrorDocument 407 default
            ErrorDocument 408 default
            ErrorDocument 409 default
            ErrorDocument 410 default
            ErrorDocument 411 default
            ErrorDocument 412 default
            ErrorDocument 413 default
            ErrorDocument 414 default
            ErrorDocument 415 default
            ErrorDocument 416 default
            ErrorDocument 417 default
            #ErrorDocument 418 default
            ErrorDocument 421 default
            ErrorDocument 422 default
            ErrorDocument 423 default
            ErrorDocument 424 default
            ErrorDocument 426 default
            ErrorDocument 428 default
            ErrorDocument 429 default
            ErrorDocument 431 default
            ErrorDocument 451 default
            ErrorDocument 500 default
            ErrorDocument 501 default
            ErrorDocument 502 default
            ErrorDocument 503 default
            ErrorDocument 504 default
            ErrorDocument 505 default
            ErrorDocument 506 default
            ErrorDocument 507 default
            ErrorDocument 508 default
            ErrorDocument 510 default
            ErrorDocument 511 default
        </virtualhost>
    </IfModule> 
    
    • 0

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    JSON数组使用jq来bash变量

    • 4 个回答
  • Marko Smith

    日期可以为 GMT 时区格式化当前时间吗?[复制]

    • 2 个回答
  • Marko Smith

    bash + 通过 bash 脚本从文件中读取变量和值

    • 4 个回答
  • Marko Smith

    如何复制目录并在同一命令中重命名它?

    • 4 个回答
  • Marko Smith

    ssh 连接。X11 连接因身份验证错误而被拒绝

    • 3 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Marko Smith

    systemctl 命令在 RHEL 6 中不起作用

    • 3 个回答
  • Marko Smith

    rsync 端口 22 和 873 使用

    • 2 个回答
  • Marko Smith

    以 100% 的利用率捕捉 /dev/loop -- 没有可用空间

    • 1 个回答
  • Marko Smith

    jq 打印子对象中所有的键和值

    • 2 个回答
  • Martin Hope
    EHerman JSON数组使用jq来bash变量 2017-12-31 14:50:58 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Drux 日期可以为 GMT 时区格式化当前时间吗?[复制] 2017-12-26 11:35:07 +0800 CST
  • Martin Hope
    AllisonC 如何复制目录并在同一命令中重命名它? 2017-12-22 05:28:06 +0800 CST
  • Martin Hope
    Steve “root”用户的文件权限如何工作? 2017-12-22 02:46:01 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST
  • Martin Hope
    Cbhihe 将默认编辑器更改为 vim for _ sudo systemctl edit [unit-file] _ 2017-12-03 10:11:38 +0800 CST
  • Martin Hope
    showkey 如何下载软件包而不是使用 apt-get 命令安装它? 2017-12-03 02:15:02 +0800 CST
  • Martin Hope
    youxiao 为什么目录 /home、/usr、/var 等都具有相同的 inode 编号 (2)? 2017-12-02 05:33:41 +0800 CST
  • Martin Hope
    user223600 gpg —list-keys 命令在将私钥导入全新安装后输出 uid [未知] 2017-11-26 18:26:02 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve