[英]Apache enabling dump_io for dav_svn
To debug an issue I'm having I need an Apache + Subversion server which dumps all requests and responses into a log file. 要调试问题,我需要一个Apache + Subversion服务器,该服务器将所有请求和响应都转储到日志文件中。 This is not meant for production, that's why authentication is disabled as well.
这不是用于生产,这就是为什么也禁用身份验证的原因。
I'm stuck with dump_io, my error.log does not contain requests/responses. 我被dump_io困扰,我的error.log不包含请求/响应。
Here's the relevant setup. 这是相关的设置。
Dockerfile Dockerfile
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 dav_svn.conf
<Location /svn/>
DAV svn
DavDepthInfinity on
SVNParentPath /var/local/svn/
Satisfy Any
Allow from all
DirectorySlash Off
LogLevel debug
</Location>
000-default.conf (this is the default, I only added the LogLevel line) 000-default.conf(这是默认值,我只添加了LogLevel行)
<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>
Put the three files in a folder and 将这三个文件放在一个文件夹中,
docker build -t svn-server .
docker run -it -p 3570:80 --rm svn-server
curl http://localhost:3570/svn/myrepo
After making the request I would expect /var/log/apache2/error.log
to contain the full response of GET /svn/myrepo
. 发出请求后,我希望
/var/log/apache2/error.log
包含GET /svn/myrepo
的完整响应。
After a night of sleep and some RTFM I found the solution. 经过一夜的睡眠和一些RTFM,我找到了解决方案。
I sprinkled some 我洒了一些
LogLevel dumpio:trace7
all over and it works. 遍及一切。
Why that isn't the default is beyond me. 为什么不是默认值超出了我的范围。 You have to enable/disable
DumpIOInput
and DumpIOOutput
anyway. 无论如何,您必须启用/禁用
DumpIOInput
和DumpIOOutput
。
Additionally, mod_dumpio needs to be configured to LogLevel trace7:
此外,需要将mod_dumpio配置为LogLevel trace7:
https://httpd.apache.org/docs/2.4/mod/mod_dumpio.html https://httpd.apache.org/docs/2.4/mod/mod_dumpio.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.