首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apache为dav_svn启用dav_svn

Apache为dav_svn启用dav_svn
EN

Stack Overflow用户
提问于 2019-01-24 13:52:25
回答 1查看 416关注 0票数 0

要调试一个问题,我需要一个Apache + Subversion服务器,它将所有请求和响应转储到一个日志文件中。这并不是用于生产的,这也是身份验证也被禁用的原因。

我被dump_io困住了,我的error.log不包含请求/响应。

这是相关的设置。

Dockerfile

代码语言:javascript
复制
FROM ubuntu:18.04

RUN apt-get update
RUN apt-get install -y apache2
RUN apt-get install -y subversion libapache2-mod-svn libsvn-dev
RUN apt-get install -y less nano
RUN a2enmod dav
RUN a2enmod dav_svn
RUN a2enmod dump_io
RUN printf "DumpIOInput On\nDumpIOOutput On\nLogLevel debug" >> /etc/apache2/apache2.conf
RUN service apache2 restart

COPY dav_svn.conf /etc/apache2/mods-enabled/dav_svn.conf
COPY 000-default.conf /etc/apache2/sites-enabled/000-default.conf

RUN mkdir -p /var/local/svn
RUN svnadmin create /var/local/svn/myrepo
RUN chown -R www-data:www-data /var/local/svn
RUN chmod -R 775 /var/local/svn

EXPOSE 80

CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

dav_svn.conf

代码语言:javascript
复制
<Location /svn/>
  DAV svn
  DavDepthInfinity on

  SVNParentPath /var/local/svn/

  Satisfy Any
  Allow from all
  DirectorySlash Off

  LogLevel debug
</Location>

2000-default.conf(这是默认的,我只添加了LogLevel行)

代码语言:javascript
复制
<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn
        LogLevel debug

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

将这三个文件放在一个文件夹中

代码语言:javascript
复制
docker build -t svn-server .
docker run -it -p 3570:80 --rm svn-server
curl http://localhost:3570/svn/myrepo

在提出请求之后,我希望/var/log/apache2/error.log包含GET /svn/myrepo的全部响应。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-01-25 08:55:24

经过一夜的睡眠和一些RTFM,我找到了解决办法。

我撒了一些

代码语言:javascript
复制
LogLevel dumpio:trace7

到处都是,而且很管用。

为什么这不是默认的,我无法理解。无论如何,您必须启用/禁用DumpIOInputDumpIOOutput

此外,需要将mod_dumpio配置为LogLevel trace7:

dumpio.html

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54348233

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档