44 lines
1.3 KiB
Docker
44 lines
1.3 KiB
Docker
FROM httpd:2.4
|
|
|
|
# Enable required modules
|
|
RUN sed -i \
|
|
-e 's/^#LoadModule rewrite_module/LoadModule rewrite_module/' \
|
|
-e 's/^#LoadModule headers_module/LoadModule headers_module/' \
|
|
-e 's/^#LoadModule autoindex_module/LoadModule autoindex_module/' \
|
|
-e 's/^#LoadModule alias_module/LoadModule alias_module/' \
|
|
-e 's/^#LoadModule proxy_module/LoadModule proxy_module/' \
|
|
-e 's/^#LoadModule proxy_http_module/LoadModule proxy_http_module/' \
|
|
-e 's/^#LoadModule ssl_module/LoadModule ssl_module/' \
|
|
/usr/local/apache2/conf/httpd.conf
|
|
|
|
# Configure autoindex + icons + .htaccess + unrestricted reverse-proxy permissions
|
|
RUN printf '\n# --- Custom for file listing + .htaccess ---\n\
|
|
AddDefaultCharset UTF-8\n\
|
|
\n\
|
|
Include conf/extra/httpd-autoindex.conf\n\
|
|
\n\
|
|
Alias /icons/ "/usr/local/apache2/icons/"\n\
|
|
<Directory "/usr/local/apache2/icons">\n\
|
|
Require all granted\n\
|
|
</Directory>\n\
|
|
\n\
|
|
# Autoindex settings\n\
|
|
IndexOptions FancyIndexing FoldersFirst NameWidth=*\n\
|
|
\n\
|
|
<Directory "/usr/local/apache2/htdocs">\n\
|
|
Options Indexes FollowSymLinks\n\
|
|
IndexIgnore _*\n\
|
|
AllowOverride All\n\
|
|
Require all granted\n\
|
|
</Directory>\n\
|
|
\n\
|
|
# Allow RewriteRule [P] from trusted .htaccess files\n\
|
|
ProxyRequests Off\n\
|
|
ProxyVia Off\n\
|
|
SSLProxyEngine on\n\
|
|
<Proxy "*">\n\
|
|
Require all granted\n\
|
|
</Proxy>\n' >> /usr/local/apache2/conf/httpd.conf
|
|
|
|
EXPOSE 80
|