forked from vulhub/vulhub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
83 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
FROM vulhub/php:5.4.1 | ||
|
||
LABEL maintainer="phithon <[email protected]>" | ||
|
||
##<autogenerated>## | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
apache2 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV APACHE_CONFDIR /etc/apache2 | ||
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars | ||
|
||
RUN set -ex \ | ||
\ | ||
# generically convert lines like | ||
# export APACHE_RUN_USER=www-data | ||
# into | ||
# : ${APACHE_RUN_USER:=www-data} | ||
# export APACHE_RUN_USER | ||
# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") | ||
&& sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ | ||
\ | ||
# setup directories and permissions | ||
&& . "$APACHE_ENVVARS" \ | ||
&& for dir in \ | ||
"$APACHE_LOCK_DIR" \ | ||
"$APACHE_RUN_DIR" \ | ||
"$APACHE_LOG_DIR" \ | ||
/var/www/html \ | ||
; do \ | ||
rm -rvf "$dir" \ | ||
&& mkdir -p "$dir" \ | ||
&& chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ | ||
done | ||
|
||
# Apache + PHP requires preforking Apache for best results | ||
RUN a2dismod mpm_event && a2enmod mpm_prefork | ||
|
||
# logs should go to stdout / stderr | ||
RUN set -ex \ | ||
&& . "$APACHE_ENVVARS" \ | ||
&& ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ | ||
&& ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ | ||
&& ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" | ||
|
||
# PHP files should be handled by PHP, and should be preferred over any other file type | ||
RUN { \ | ||
echo '<FilesMatch \.php$>'; \ | ||
echo '\tSetHandler application/x-httpd-php'; \ | ||
echo '</FilesMatch>'; \ | ||
echo; \ | ||
echo 'DirectoryIndex disabled'; \ | ||
echo 'DirectoryIndex index.php index.html'; \ | ||
echo; \ | ||
echo '<Directory /var/www/>'; \ | ||
echo '\tOptions -Indexes'; \ | ||
echo '\tAllowOverride All'; \ | ||
echo '</Directory>'; \ | ||
} | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ | ||
&& a2enconf docker-php | ||
|
||
COPY apache2-foreground docker-php-* /usr/local/bin/ | ||
|
||
WORKDIR /var/www/html | ||
|
||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["docker-php-entrypoint"] | ||
CMD ["apache2-foreground"] |
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# first arg is `-f` or `--some-option` | ||
if [ "${1#-}" != "$1" ]; then | ||
set -- php "$@" | ||
fi | ||
|
||
exec "$@" |
File renamed without changes.
File renamed without changes.