| 1 |
# apache2 -X -d /etc/frontend -e debug |
| 2 |
|
| 3 |
# apt-get install apache2 libapache2-mod-perl2 libdata-dump-perl libcommon-sense-perl |
| 4 |
|
| 5 |
#ServerRoot "/dev/null" |
| 6 |
Mutex pthread default |
| 7 |
PidFile /run/frontend.pid |
| 8 |
|
| 9 |
Timeout 30 |
| 10 |
KeepAlive On |
| 11 |
MaxKeepAliveRequests 100 |
| 12 |
KeepAliveTimeout 2 |
| 13 |
|
| 14 |
#TODO: should be it's own user id |
| 15 |
User www-data |
| 16 |
Group www-data |
| 17 |
|
| 18 |
GracefulShutdownTimeout 8 |
| 19 |
|
| 20 |
AddDefaultCharset UTF-8 |
| 21 |
# EnableSendfile On |
| 22 |
|
| 23 |
# to be sure, spell out some defaults |
| 24 |
HostnameLookups Off |
| 25 |
AllowEncodedSlashes Off |
| 26 |
|
| 27 |
# LogLevel: Control the severity of messages logged to the error_log. |
| 28 |
# Available values: trace8, ..., trace1, debug, info, notice, warn, |
| 29 |
# error, crit, alert, emerg. |
| 30 |
# It is also possible to configure the log level for particular modules, e.g. |
| 31 |
# "LogLevel info ssl:warn" |
| 32 |
# |
| 33 |
LogLevel warn |
| 34 |
|
| 35 |
# event segfaults, hangs, creates unexplained error messages... |
| 36 |
LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so |
| 37 |
#LoadModule mpm_worker_module /usr/lib/apache2/modules/mod_mpm_worker.so |
| 38 |
#LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so |
| 39 |
LoadModule authz_core_module /usr/lib/apache2/modules/mod_authz_core.so |
| 40 |
LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so |
| 41 |
|
| 42 |
LoadModule http2_module /usr/lib/apache2/modules/mod_http2.so |
| 43 |
H2SerializeHeaders On |
| 44 |
Protocols h2 http/1.1 |
| 45 |
H2WebSockets Off |
| 46 |
H2MinWorkers 2 |
| 47 |
H2MaxWorkers 64 |
| 48 |
H2MaxWorkerIdleSeconds 60 |
| 49 |
|
| 50 |
LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so |
| 51 |
TypesConfig /etc/mime.types |
| 52 |
LoadModule mime_magic_module /usr/lib/apache2/modules/mod_mime_magic.so |
| 53 |
MIMEMagicFile /etc/apache2/magic |
| 54 |
|
| 55 |
# must NOT be loaded |
| 56 |
#LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so |
| 57 |
#DirectoryIndex index.html |
| 58 |
|
| 59 |
LoadModule autoindex_module /usr/lib/apache2/modules/mod_autoindex.so |
| 60 |
IndexOptions Charset=UTF-8 FancyIndexing FoldersFirst HTMLTable IgnoreCase SuppressColumnSorting NameWidth=* SuppressDescription SuppressIcon |
| 61 |
HeaderName HEADER.html |
| 62 |
ReadmeName FOOTER.html |
| 63 |
|
| 64 |
LoadModule status_module /usr/lib/apache2/modules/mod_status.so |
| 65 |
#ExtendedStatus Off # ON is the default |
| 66 |
|
| 67 |
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so |
| 68 |
LoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so |
| 69 |
#LoadModule proxy_fcgi_module /usr/lib/apache2/modules/mod_proxy_fcgi.so |
| 70 |
|
| 71 |
LoadModule proxy_scgi_module /usr/lib/apache2/modules/mod_proxy_scgi.so |
| 72 |
#ProxySCGIInternalRedirect Internal-Redirect apache 2.6 :/ |
| 73 |
ProxySCGIInternalRedirect On |
| 74 |
ProxySCGISendfile On |
| 75 |
ProxyTimeout 120 |
| 76 |
|
| 77 |
#LoadModule proxy_fdpass_module /usr/lib/apache2/modules/mod_proxy_fdpass.so |
| 78 |
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so |
| 79 |
LoadModule xml2enc_module /usr/lib/apache2/modules/mod_xml2enc.so |
| 80 |
#LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so |
| 81 |
LoadModule proxy_html_module /usr/lib/apache2/modules/mod_proxy_html.so |
| 82 |
|
| 83 |
LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so |
| 84 |
|
| 85 |
#<Directory /> |
| 86 |
# Options FollowSymLinks |
| 87 |
# AllowOverride None |
| 88 |
## Require all denied |
| 89 |
#</Directory> |
| 90 |
|
| 91 |
#AccessFileName .htaccess |
| 92 |
|
| 93 |
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %{Host}i" schmorp |
| 94 |
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined |
| 95 |
LogFormat "%h %l %u %t \"%r\" %>s %O" common |
| 96 |
LogFormat "%{Referer}i -> %U" referer |
| 97 |
LogFormat "%{User-agent}i" agent |
| 98 |
|
| 99 |
CustomLog /var/log/frontend/access.log schmorp env=!suppress-logging |
| 100 |
ErrorLog /var/log/frontend/error.log |
| 101 |
|
| 102 |
ListenBacklog 511 |
| 103 |
|
| 104 |
# use only one server normally, but allow concurrent servers running during reload |
| 105 |
ServerLimit 4 |
| 106 |
|
| 107 |
#MaxClients 100 |
| 108 |
MaxRequestWorkers 200 |
| 109 |
StartServers 1 |
| 110 |
ThreadsPerChild 200 |
| 111 |
ThreadLimit 200 |
| 112 |
MinSpareThreads 6 |
| 113 |
MaxSpareThreads 200 |
| 114 |
|
| 115 |
MaxMemFree 64 |
| 116 |
#ThreadStackSize 196608 |
| 117 |
|
| 118 |
PerlInterpStart 1 |
| 119 |
PerlInterpMax 1 |
| 120 |
PerlInterpMinSpare 0 |
| 121 |
PerlInterpMaxSpare 1 |
| 122 |
#PerlInterpScope Handler |
| 123 |
|
| 124 |
Include proxy_html.conf |
| 125 |
|
| 126 |
# for debugging, enable reverse proxy url rewrite logging |
| 127 |
#LogLevel warn proxy_html:trace3 |
| 128 |
|
| 129 |
ProxyHTMLDocType "<!DOCTYPE html>" SGML |
| 130 |
ProxyHTMLExtended on |
| 131 |
|
| 132 |
# mod_proxy_html uncompresses content, but doesn't recompress nor remove |
| 133 |
# content-encoding header |
| 134 |
#SetOutputFilter INFLATE;DEFLATE |
| 135 |
|
| 136 |
<Perl> |
| 137 |
use Apache2::ServerUtil (); |
| 138 |
use Apache2::Const -compile => qw(OK); |
| 139 |
use lib Apache2::ServerUtil::server_root; |
| 140 |
use proxy_impl; |
| 141 |
</Perl> |
| 142 |
|
| 143 |
PerlOptions None +Trans +MapToStorage +HeaderParser +Authz +Type |
| 144 |
|
| 145 |
PerlTransHandler Apache2::Const::OK |
| 146 |
PerlMapToStorageHandler proxy_impl::map_to_storage |
| 147 |
PerlHeaderParserHandler Apache2::Const::OK |
| 148 |
|
| 149 |
#PerlAuthenHandler Apache2::Const::OK |
| 150 |
PerlAuthzHandler Apache2::Const::OK |
| 151 |
|
| 152 |
# always runs all |
| 153 |
#PerlAccessHandler Apache2::Const::OK |
| 154 |
#PerlTypeHandler Apache2::Const::OK |
| 155 |
#PerlFixupHandler Apache2::Const::OK |
| 156 |
|
| 157 |
# handlers run anyway |
| 158 |
# fixup mod_proxy checks for proxy: handler strings |
| 159 |
# fixup mod_ssl annotates with lots of ssl, or updates for ssl optional |
| 160 |
# type mod_mime mod_mime_magic do their job |
| 161 |
|
| 162 |
# RUN_FIRST translate_name |
| 163 |
# RUN_FIRST map_to_storage |
| 164 |
# RUN_FIRST check_user_id |
| 165 |
# RUN_ALL fixups |
| 166 |
# RUN_FIRST type_checker |
| 167 |
# RUN_ALL access_checker |
| 168 |
# RUN_FIRST access_checker_ex |
| 169 |
# RUN_FIRST auth_checker |
| 170 |
# VOID insert_filter |
| 171 |
# RUN_ALL create_request |
| 172 |
# RUN_ALL post_perdir_config |
| 173 |
# RUN_FIRST dirwalk_stat |
| 174 |
|
| 175 |
# mod_dir fixup |
| 176 |
# mod_cgi response |
| 177 |
# mod_autoindex response |
| 178 |
# ap_process_request_internal() function in server/request.c |
| 179 |
|
| 180 |
<Location /> |
| 181 |
Options Indexes FollowSymLinks |
| 182 |
# Require all granted |
| 183 |
</Location> |
| 184 |
|
| 185 |
#LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so |
| 186 |
# |
| 187 |
#<FilesMatch "\.(ttf|woff|woff2)$"> |
| 188 |
# Header setifempty Access-Control-Allow-Origin "*" |
| 189 |
# Header setifempty Cache-Comtrol "public, max-age=86400, immutable" |
| 190 |
#</FilesMatch> |
| 191 |
|
| 192 |
Include local.conf |
| 193 |
|
| 194 |
# vim: syntax=apache ts=8 sw=4 |
| 195 |
|