Created
December 5, 2018 19:37
-
-
Save elieux/08fdfd299b84153b6eec4ea535ab81bc to your computer and use it in GitHub Desktop.
Why does HTTPd do this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
apt update | |
DEBIAN_FRONTEND=noninteractive apt "$@" | |
apt clean | |
apt autoremove -y | |
rm -rf /var/log/{alternatives.log,apt,dpkg.log} | |
rm -rf /var/cache/apt | |
rm -rf /var/lib/apt/lists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80 *:443> | |
ServerName test | |
DocumentRoot "/var/www/html" | |
</VirtualHost> | |
<Directory "/var/www/html/"> | |
Options FollowSymLinks | |
AllowOverride All | |
<FilesMatch "foo"> | |
RewriteEngine On | |
RewriteRule .* - [F] | |
</FilesMatch> | |
</Directory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is default. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
COPY ./apt-wrapper.sh /tmp/apt | |
RUN chmod +x /tmp/apt | |
RUN /tmp/apt install -y --no-install-recommends apache2='2.4.*' | |
RUN a2enmod rewrite | |
RUN a2dissite 000-default | |
RUN sed -e '/^*)/ { n; s/$HTTPD/exec &/; }' -i /usr/sbin/apache2ctl | |
ENTRYPOINT [ "apache2ctl" ] | |
CMD [ "-DFOREGROUND" ] | |
EXPOSE 80 | |
COPY ./default.conf /etc/apache2/sites-available/default.conf | |
RUN a2ensite default | |
RUN rm /var/www/html/index.* | |
COPY ./htaccess /var/www/html/.htaccess | |
COPY ./*.html /var/www/html/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteRule ^(foo|bar)$ /default.html [L] | |
RewriteRule ^baz$ /foobar [L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="bar">bar</a> - should work and does<br/> | |
<a href="foo">foo</a> - should work, but doesn't<br/> | |
<a href="baz">baz</a> - shouldn't work and doesn't<br/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment