first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
40
base/php/5.4.1/cgi/Dockerfile
Normal file
40
base/php/5.4.1/cgi/Dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
FROM vulhub/php:5.4.1
|
||||
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
apache2 \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& \
|
||||
{ \
|
||||
echo; \
|
||||
echo '<Directory "/usr/local/bin">'; \
|
||||
echo ' Require all granted'; \
|
||||
echo ' Options ExecCGI'; \
|
||||
echo '</Directory>'; \
|
||||
echo; \
|
||||
echo 'ScriptAlias /local-bin /usr/local/bin'; \
|
||||
echo; \
|
||||
echo "<Directory \"/var/www/html\">"; \
|
||||
echo ' AddHandler application/x-httpd-php5 php'; \
|
||||
echo ' Action application/x-httpd-php5 /local-bin/php-cgi'; \
|
||||
echo ' Options -Indexes'; \
|
||||
echo ' Require all granted'; \
|
||||
echo ' DirectoryIndex index.html index.php'; \
|
||||
echo '</Directory>'; \
|
||||
echo; \
|
||||
} >> /etc/apache2/conf-available/php.conf \
|
||||
&& a2enmod cgid \
|
||||
&& a2enmod actions \
|
||||
&& a2disconf serve-cgi-bin \
|
||||
&& a2enconf php
|
||||
|
||||
COPY apache2-foreground /usr/local/bin/
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["apache2-foreground"]
|
40
base/php/5.4.1/cgi/apache2-foreground
Normal file
40
base/php/5.4.1/cgi/apache2-foreground
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Note: we don't just use "apache2ctl" here because it itself is just a shell-script wrapper around apache2 which provides extra functionality like "apache2ctl start" for launching apache2 in the background.
|
||||
# (also, when run as "apache2ctl <apache args>", it does not use "exec", which leaves an undesirable resident shell process)
|
||||
|
||||
: "${APACHE_CONFDIR:=/etc/apache2}"
|
||||
: "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}"
|
||||
if test -f "$APACHE_ENVVARS"; then
|
||||
. "$APACHE_ENVVARS"
|
||||
fi
|
||||
|
||||
# Apache gets grumpy about PID files pre-existing
|
||||
: "${APACHE_RUN_DIR:=/var/run/apache2}"
|
||||
: "${APACHE_PID_FILE:=$APACHE_RUN_DIR/apache2.pid}"
|
||||
rm -f "$APACHE_PID_FILE"
|
||||
|
||||
# create missing directories
|
||||
# (especially APACHE_RUN_DIR, APACHE_LOCK_DIR, and APACHE_LOG_DIR)
|
||||
for e in "${!APACHE_@}"; do
|
||||
if [[ "$e" == *_DIR ]] && [[ "${!e}" == /* ]]; then
|
||||
# handle "/var/lock" being a symlink to "/run/lock", but "/run/lock" not existing beforehand, so "/var/lock/something" fails to mkdir
|
||||
# mkdir: cannot create directory '/var/lock': File exists
|
||||
dir="${!e}"
|
||||
while [ "$dir" != "$(dirname "$dir")" ]; do
|
||||
dir="$(dirname "$dir")"
|
||||
if [ -d "$dir" ]; then
|
||||
break
|
||||
fi
|
||||
absDir="$(readlink -f "$dir" 2>/dev/null || :)"
|
||||
if [ -n "$absDir" ]; then
|
||||
mkdir -p "$absDir"
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p "${!e}"
|
||||
fi
|
||||
done
|
||||
|
||||
exec apache2 -DFOREGROUND "$@"
|
Reference in New Issue
Block a user