Browse Source

replace entire apache2.conf

Fabian Peter Hammerle 5 years ago
parent
commit
b1fa386453
3 changed files with 57 additions and 33 deletions
  1. 2 7
      Dockerfile
  2. 0 26
      apache2-koel.conf
  3. 55 0
      apache2.conf

+ 2 - 7
Dockerfile

@@ -34,14 +34,9 @@ RUN docker-php-ext-install -j$(nproc) \
     exif \
     pdo_pgsql \
     zip
-# AH00100: apache2: could not log pid to file
-RUN sed --in-place '/^PidFile /d' /etc/apache2/apache2.conf
-RUN find /etc/apache2/sites-enabled -name '*.conf' -delete
-RUN echo >/etc/apache2/ports.conf
 RUN a2enmod headers rewrite
-# TODO replace /etc/apache2/apache2.conf
-COPY ./apache2-koel.conf /etc/apache2/
-RUN echo "Include /etc/apache2/apache2-koel.conf" >>/etc/apache2/apache2.conf
+RUN a2disconf other-vhosts-access-log
+COPY ./apache2.conf /etc/apache2/apache2.conf
 EXPOSE 8080
 COPY --from=js-build /koel /koel
 WORKDIR /koel

+ 0 - 26
apache2-koel.conf

@@ -1,26 +0,0 @@
-Listen 8080
-# <IfModule ssl_module>
-# 	Listen 443
-# </IfModule>
-# <IfModule mod_gnutls.c>
-# 	Listen 443
-# </IfModule>
-
-ServerTokens Prod
-ServerSignature Off
-Header set X-Frame-Options: "sameorigin"
-
-# LogLevel info rewrite:trace3
-
-# TODO ssl
-# TODO sendfile ?
-
-<VirtualHost *:8080>
-    DocumentRoot /koel
-</VirtualHost>
-
-<Directory /koel>
-    # TODO check
-	AllowOverride All
-	Require all granted
-</Directory>

+ 55 - 0
apache2.conf

@@ -0,0 +1,55 @@
+ErrorLog /dev/stderr
+LogLevel warn
+# LogLevel info rewrite:trace3
+
+# need to be set in /etc/apache2/envvars
+User ${APACHE_RUN_USER}
+Group ${APACHE_RUN_GROUP}
+
+IncludeOptional mods-enabled/*.load
+IncludeOptional mods-enabled/*.conf
+
+Timeout 256
+KeepAlive On
+MaxKeepAliveRequests 32
+KeepAliveTimeout 8
+
+Listen 8080
+# <IfModule ssl_module>
+# 	Listen 443
+# </IfModule>
+# <IfModule mod_gnutls.c>
+# 	Listen 443
+# </IfModule>
+
+ServerTokens Prod
+ServerSignature Off
+Header set X-Frame-Options: "sameorigin"
+
+LogFormat "%{%Y-%m-%dT%H:%M:%S%z}t %h \"%r\" %>s" neat
+CustomLog /dev/stdout neat
+
+<VirtualHost *:8080>
+    # TODO ssl
+    # TODO sendfile ?
+    DocumentRoot /koel
+</VirtualHost>
+
+<Directory />
+	Options FollowSymLinks
+	AllowOverride None
+	Require all denied
+</Directory>
+
+AccessFileName .htaccess
+<FilesMatch "^\.ht">
+	Require all denied
+</FilesMatch>
+
+<Directory /koel>
+    # TODO check
+	AllowOverride All
+	Require all granted
+</Directory>
+
+IncludeOptional conf-enabled/*.conf