Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Summary of release changes.
- Adds `SYSTEM_TIMEZONE` handling to Makefile, scmi, systemd unit and docker-compose templates.
- Adds system time zone validation to healthcheck.
- Adds lock/state file to bootstrap/wrapper scripts.
- Adds `php-wrapper` and `fcgid.conf` as part of the service; removing dependency on the php-hello-world app.
- Removes unused `DOCKER_PORT_MAP_TCP_22` variable from environment includes.
- Removes support for long image tags (i.e. centos-7-2.x.x).
- Removes `APACHE_AUTOSTART_HTTPD_BOOTSTRAP`, replaced with `ENABLE_HTTPD_BOOTSTRAP`.
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ RUN mkdir -p -m 750 ${PACKAGE_PATH} \
&& mv \
${PACKAGE_PATH}/public \
${PACKAGE_PATH}/public_html \
&& rm -f \
${PACKAGE_PATH}/bin/php-wrapper \
${PACKAGE_PATH}/etc/httpd/conf.d/50-fcgid.conf \
&& $(\
if [[ -f /usr/share/php-pecl-apc/apc.php ]]; then \
cp \
Expand Down
19 changes: 19 additions & 0 deletions src/etc/httpd/conf.d/00-fcgid.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<IfModule fcgid_module>
AddHandler fcgid-script php
AddType text/html php
DirectoryIndex index.php
FcgidFixPathinfo 1
FcgidIOTimeout 360
FcgidIdleTimeout 1800
FcgidMaxProcesses 10
FcgidMaxRequestLen 157286400
FcgidMaxRequestsPerProcess 10000
FcgidPassHeader Authorization

<Directory "${APACHE_CONTENT_ROOT}/${APACHE_PUBLIC_DIRECTORY}">
FcgidWrapper "/var/www/cgi-bin/php-wrapper --tmp=${APACHE_CONTENT_ROOT}/var/tmp" .php
<FilesMatch "\.php$">
Options +ExecCGI
</FilesMatch>
</Directory>
</IfModule>
50 changes: 50 additions & 0 deletions src/var/www/cgi-bin/php-wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

function main ()
{
local -r bin="/usr/bin/php-cgi"
local -r nice="/bin/nice"
local -r niceness="15"

local bin_options
local option
local -a options
local tmp="/var/tmp"

while [[ "${#}" -gt 0 ]]
do
case "${1}" in
-d)
options+=("${2}")
shift 2
;;
--tmp=*)
tmp="${1#*=}"
shift 1
;;
esac
done

if [[ ${#options[@]} -gt 0 ]]
then
for option in "${options[@]}"
do
bin_options+=" -d ${option}"
done
fi

export PHP_FCGI_CHILDREN="0"
export PHP_FCGI_MAX_REQUESTS="15000"
export PHPRC="/etc"
export REDIRECT_STATUS="200"
export TMP="${tmp}"
export TEMP="${tmp}"
export TMPDIR="${tmp}"

exec ${nice} \
-n ${niceness} \
${bin} \
${bin_options}
}

main "${@}"