Skip to content

Commit

Permalink
Further cleanup...
Browse files Browse the repository at this point in the history
  • Loading branch information
iaean committed Mar 15, 2018
1 parent 772dc78 commit c5a49c5
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 29 deletions.
30 changes: 16 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,38 +67,40 @@ 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
RUN svn --username guest --password "" export http://websvn.tigris.org/svn/websvn/tags/${WEBSVN_VERSION} /var/www/html/ && \
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/
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions apache.conf/svn.conf → apache.conf/conf.d/svn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
9 changes: 5 additions & 4 deletions apache.conf/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ DocumentRoot "/var/www/localhost/htdocs"
Require all denied
</Files>

# 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

<IfModule log_config_module>
Expand All @@ -72,8 +72,9 @@ LogLevel warn
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
# 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
</IfModule>

<IfModule headers_module>
Expand Down
26 changes: 17 additions & 9 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 >/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 #>/dev/null 2>&1
else # dev
httpd -k start
fi
Expand Down

0 comments on commit c5a49c5

Please sign in to comment.