| # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| |
| # Set a define so we can conditionally exclude some lab apache settings |
| # in the main configuration. |
| Define MOBLAB_INSTANCE True |
| |
| PassEnv CROS_CACHEDIR |
| # Protect moblab from securtiy scans as it crashes the device. |
| <IfModule mod_rewrite.c> |
| RewriteEngine On |
| RewriteCond %{HTTP_USER_AGENT} ^$ [OR] |
| RewriteCond %{HTTP_USER_AGENT} ^.*(GoogleSecurityScanner).* [NC] |
| RewriteRule ^(.*)$ - [F,L] |
| </IfModule> |
| |
| LoadModule wsgi_module modules/mod_wsgi.so |
| ServerName localhost |
| Listen 80 |
| Include /usr/local/autotest/apache/apache-conf |
| PidFile /run/apache2.pid |
| |
| # Setup wmatrix under a sub-directory of the web server |
| Include /whining/apache-conf |
| |
| # Override default logging and limit the size of the logs |
| ErrorLog "|/usr/sbin/rotatelogs -n 2 /var/log/apache2/error_log 50M" |
| CustomLog "|/usr/sbin/rotatelogs -n 2 /var/log/apache2/access_log 50M" common |
| |
| # Limit Apache's memory settings. |
| StartServers 2 |
| MinSpareServers 2 |
| MaxSpareServers 75 |
| MaxRequestWorkers 128 |
| # Note that restarting Apache's processes does not restart the WSGI Daemon |
| # processes, which is where memory is leaked from the application. Changing |
| # this value does not do much. |
| MaxClients 128 |
| MaxRequestsPerChild 10000 |
| |
| WSGIRestrictEmbedded On |
| WSGIApplicationGroup %{GLOBAL} |
| |
| # Each request can leak about 60MB of space, which is 1.5% of a moblab's memory. |
| # If we want 90% maximum memory utilization, then we can only have |
| # 90 = 1.5 * processes * maximum_requests. |
| WSGIDaemonProcess autotestapache |