From c5a49c581d1a8abe507e41d700439ff17e3d2f30 Mon Sep 17 00:00:00 2001 From: iaean Date: Thu, 15 Mar 2018 13:30:49 +0100 Subject: [PATCH] Further cleanup... --- Dockerfile | 30 +++++++++++++------------ apache.conf/{ => conf.d}/autoindex.conf | 0 apache.conf/{ => conf.d}/ldap.conf | 0 apache.conf/{ => conf.d}/mpm.conf | 0 apache.conf/{ => conf.d}/svn.conf | 5 +++-- apache.conf/{ => conf.d}/websvn.conf | 0 apache.conf/httpd.conf | 9 ++++---- docker-entrypoint.sh | 26 +++++++++++++-------- 8 files changed, 41 insertions(+), 29 deletions(-) rename apache.conf/{ => conf.d}/autoindex.conf (100%) rename apache.conf/{ => conf.d}/ldap.conf (100%) rename apache.conf/{ => conf.d}/mpm.conf (100%) rename apache.conf/{ => conf.d}/svn.conf (93%) rename apache.conf/{ => conf.d}/websvn.conf (100%) diff --git a/Dockerfile b/Dockerfile index f2b246c..3e4ed0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,14 +67,6 @@ RUN apk add --no-cache apache2 apache2-webdav apache2-ldap apache2-utils && \ /etc/apache2/conf.d/userdir.conf && \ mkdir /run/apache2 -COPY apache.conf/httpd.conf /etc/apache2/ -COPY apache.conf/ldap.conf /etc/apache2/conf.d/ -COPY apache.conf/mpm.conf /etc/apache2/conf.d/ -COPY apache.conf/svn.conf /etc/apache2/conf.d/ -COPY apache.conf/websvn.conf /etc/apache2/conf.d/ -COPY apache.conf/autoindex.conf /etc/apache2/conf.d/ -COPY apache.conf/icons/* /var/www/localhost/icons/ - # Install WebSVN # ENV WEBSVN_VERSION=2.3.3 @@ -82,23 +74,33 @@ RUN svn --username guest --password "" export http://websvn.tigris.org/svn/websv chown -R apache:apache /var/www/html/cache && \ chmod -R 0700 /var/www/html/cache -COPY websvn.conf /var/www/html/include/config.php -# COPY websvn.conf /var/www/localhost/htdocs/websvn/include/config.php - RUN mkdir -p /data/dist && \ svn cat https://svn.apache.org/repos/asf/subversion/trunk/tools/xslt/svnindex.css > /data/dist/.svnindex.css && \ svn cat https://svn.apache.org/repos/asf/subversion/trunk/tools/xslt/svnindex.xsl > /data/dist/.svnindex.xsl && \ sed -i 's/\/svnindex.css/\/repos\/.svnindex.css/' /data/dist/.svnindex.xsl +RUN mkdir -p $SVN_BASE && \ + chown -R apache:apache $SVN_BASE + # apk add --no-cache joe openldap-clients libressl + +# Apache config +# +COPY apache.conf/httpd.conf /etc/apache2/ +COPY apache.conf/conf.d/*.conf /etc/apache2/conf.d/ +COPY apache.conf/icons/* /var/www/localhost/icons/ + COPY apache.conf/header.html /data/dist/.header.html COPY apache.conf/footer.html /data/dist/.footer.html COPY apache.conf/style.css /data/dist/.style.css COPY svn.access /data/dist/.svn.access -RUN mkdir -p $SVN_BASE && \ - chown -R apache:apache $SVN_BASE - # apk add --no-cache joe openldap-clients libressl +# WebSVN config +# +COPY websvn.conf /var/www/html/include/config.php +# COPY websvn.conf /var/www/localhost/htdocs/websvn/include/config.php +# SASL, LDAP, svnserve config +# COPY svnserve.conf /etc/subversion/ COPY svnsasl.conf /etc/sasl2/svn.conf COPY ldap.conf /etc/openldap/ diff --git a/apache.conf/autoindex.conf b/apache.conf/conf.d/autoindex.conf similarity index 100% rename from apache.conf/autoindex.conf rename to apache.conf/conf.d/autoindex.conf diff --git a/apache.conf/ldap.conf b/apache.conf/conf.d/ldap.conf similarity index 100% rename from apache.conf/ldap.conf rename to apache.conf/conf.d/ldap.conf diff --git a/apache.conf/mpm.conf b/apache.conf/conf.d/mpm.conf similarity index 100% rename from apache.conf/mpm.conf rename to apache.conf/conf.d/mpm.conf diff --git a/apache.conf/svn.conf b/apache.conf/conf.d/svn.conf similarity index 93% rename from apache.conf/svn.conf rename to apache.conf/conf.d/svn.conf index d4712c9..5380806 100644 --- a/apache.conf/svn.conf +++ b/apache.conf/conf.d/svn.conf @@ -25,8 +25,9 @@ BrowserMatch "MSIE [5-9]" ssl-unclean-shutdown BrowserMatch "^SVN" redirect-carefully LogFormat "%t %u %{SVN-REPOS}e: %{SVN-ACTION}e" subversion -# CustomLog logs/subversion.log subversion env=SVN-ACTION -CustomLog "|/usr/sbin/rotatelogs -t /var/log/apache2/subversion.log 86400" subversion env=SVN-ACTION + +CustomLog logs/subversion.log subversion env=SVN-ACTION +# CustomLog "|/usr/sbin/rotatelogs -t /var/log/apache2/subversion.log 86400" subversion env=SVN-ACTION RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} =https diff --git a/apache.conf/websvn.conf b/apache.conf/conf.d/websvn.conf similarity index 100% rename from apache.conf/websvn.conf rename to apache.conf/conf.d/websvn.conf diff --git a/apache.conf/httpd.conf b/apache.conf/httpd.conf index 5735f11..ab8fad3 100644 --- a/apache.conf/httpd.conf +++ b/apache.conf/httpd.conf @@ -62,8 +62,8 @@ DocumentRoot "/var/www/localhost/htdocs" Require all denied -# ErrorLog logs/error.log -ErrorLog "|/usr/sbin/rotatelogs -t /var/log/apache2/error.log 86400" +ErrorLog logs/error.log +# ErrorLog "|/usr/sbin/rotatelogs -t /var/log/apache2/error.log 86400" LogLevel warn @@ -72,8 +72,9 @@ LogLevel warn LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio - # CustomLog logs/access.log combined - CustomLog "|/usr/sbin/rotatelogs -t /var/log/apache2/access.log 86400" combined + + CustomLog logs/access.log combined + # CustomLog "|/usr/sbin/rotatelogs -t /var/log/apache2/access.log 86400" combined diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index ba24dde..5608f83 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -164,15 +164,23 @@ sudo -u apache -g apache /usr/bin/svnserve -d -r ${SVN_BASE} \ ### if [[ `basename ${1}` == "httpd" ]]; then # prod - touch /var/log/apache2/error.log - touch /var/log/apache2/subversion.log - touch /var/log/apache2/access.log - - tail -f /var/log/apache2/error.log & - tail -f /var/log/apache2/subversion.log & - tail -f /var/log/apache2/access.log & - - exec "$@" /dev/null 2>&1 + # The tail approach... + # + # touch /var/log/apache2/error.log + # touch /var/log/apache2/subversion.log + # touch /var/log/apache2/access.log + # + # tail -f /var/log/apache2/error.log & + # tail -f /var/log/apache2/subversion.log & + # tail -f /var/log/apache2/access.log & + + # The direct approach... + # + ln -s /dev/stderr /var/log/apache2/error.log + ln -s /dev/stdout /var/log/apache2/access.log + ln -s /dev/stdout /var/log/apache2/subversion.log + + exec "$@" /dev/null 2>&1 else # dev httpd -k start fi