From 345421b6820b43bb0d7ed07a6463f85907452aaf Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 21 May 2018 10:07:27 -0700 Subject: [PATCH] Better apache configs --- Dockerfile | 17 +++++++++-------- apache2.conf => apache/freshrss.conf | 0 apache/mpm_prefork.conf | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 8 deletions(-) rename apache2.conf => apache/freshrss.conf (100%) create mode 100644 apache/mpm_prefork.conf diff --git a/Dockerfile b/Dockerfile index 5dc8588..8cac844 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,15 +24,16 @@ RUN wget https://github.com/FreshRSS/Extensions/archive/${EXTENSIONS_VERSION}.ta && ln -s /app/data/extensions /app/code/extensions \ && ln -s /app/data/extensions/ttrss.php /app/code/p/api/ttrss.php -ADD apache2.conf /etc/apache2/sites-available/freshrss.conf +# configure apache +RUN rm /etc/apache2/sites-enabled/* +RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf +COPY apache/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf -RUN rm /etc/apache2/sites-enabled/* \ - && sed -e 's,^ErrorLog.*,ErrorLog "/dev/stderr",' -i /etc/apache2/apache2.conf \ - && sed -e "s,MaxSpareServers[^:].*,MaxSpareServers 5," -i /etc/apache2/mods-available/mpm_prefork.conf \ - && a2disconf other-vhosts-access-log \ - && echo "Listen 8000" > /etc/apache2/ports.conf \ - && a2enmod headers expires \ - && a2ensite freshrss +RUN a2disconf other-vhosts-access-log +ADD apache/freshrss.conf /etc/apache2/sites-enabled/freshrss.conf +RUN echo "Listen 8000" > /etc/apache2/ports.conf + +RUN a2enmod headers expires RUN rm -rf /var/lib/php \ && ln -s /run/php /var/lib/php \ diff --git a/apache2.conf b/apache/freshrss.conf similarity index 100% rename from apache2.conf rename to apache/freshrss.conf diff --git a/apache/mpm_prefork.conf b/apache/mpm_prefork.conf new file mode 100644 index 0000000..c6fc22a --- /dev/null +++ b/apache/mpm_prefork.conf @@ -0,0 +1,17 @@ + + # On startup, start these many servers + StartServers 2 + + # At any given time, keep atleast these many servers + MinSpareServers 2 + + # At any given time, keep atmost these many idle servers (this is always >= MinSpareServers+1) + MaxSpareServers 3 + + # Maximum number of servers at any given instant. Requests will be queued after this + MaxRequestWorkers 6 + + # Recycle process after handling these many requests. This protected against accidental memory leaks + MaxConnectionsPerChild 100 + +