Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 730df1b

Browse files
committed
ISSUE 133: Updates upstream source to 1.10.3
1 parent b011a61 commit 730df1b

File tree

8 files changed

+124
-39
lines changed

8 files changed

+124
-39
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Summary of release changes for Version 1.
66

77
CentOS-6 6.9 x86_64, Apache 2.2, PHP-CGI 5.3 (FastCGI), PHP memcached 1.0, PHP APC 3.1.
88

9+
### 1.10.3 - Unreleased
10+
11+
- Updates image source to [release 1.10.3](https://github.com/jdeathe/centos-ssh-apache-php/releases/tag/1.10.3).
12+
913
### 1.10.2 - 2017-12-27
1014

1115
- Updates image source to [release 1.10.2](https://github.com/jdeathe/centos-ssh-apache-php/releases/tag/1.10.2).

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# CentOS-6, Apache 2.2, PHP 5.3, PHP Memcached 1.0, PHP APC 3.1.
55
#
66
# =============================================================================
7-
FROM jdeathe/centos-ssh-apache-php:1.10.2
7+
FROM jdeathe/centos-ssh-apache-php:1.10.3
88

99
# -----------------------------------------------------------------------------
1010
# FastCGI support

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ $ docker run \
136136

137137
##### SCMI Fleet Support
138138

139+
**_Deprecation Notice:_** The fleet project is no longer maintained. The fleet `--manager` option has been deprecated in `scmi`.
140+
139141
If your docker host has systemd, fleetd (and optionally etcd) installed then `scmi` provides a method to schedule the container to run on the cluster. This provides some additional features for managing a group of instances on a [fleet](https://github.com/coreos/fleet) cluster and has the option to use an etcd backed service registry. To use the fleet method of installation use the `-m` or `--manager` option of `scmi` and to include the optional etcd register companion unit use the `--register` option.
140142

141143
##### SCMI Image Information
@@ -436,8 +438,11 @@ To set the timezone for the UK and account for British Summer Time you would use
436438

437439
Using `PHP_OPTIONS_SESSION_SAVE_HANDLER` and `PHP_OPTIONS_SESSION_SAVE_PATH` together it's possible to configure PHP to use an alternative `session.save_handler` and `session.save_path`. For example if you have a Memcached server running on the host `memcached-server` on the default port `11211` the following configuration will allow session data to be stored in Memcached, allowing session data to be shared between multiple PHP containers.
438440

441+
Using `PHP_OPTIONS_SESSION_NAME` a session name can be defined - otherwise the default name "PHPSESSID" is used.
442+
439443
```
440444
...
445+
--env "PHP_OPTIONS_SESSION_NAME=app-session" \
441446
--env "PHP_OPTIONS_SESSION_SAVE_HANDLER=memcached" \
442447
--env "PHP_OPTIONS_SESSION_SAVE_PATH=memcached-server:11211" \
443448
...

default.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ define DOCKER_CONTAINER_PARAMETERS
2626
--env "APACHE_SSL_PROTOCOL=$(APACHE_SSL_PROTOCOL)" \
2727
--env "APACHE_SYSTEM_USER=$(APACHE_SYSTEM_USER)" \
2828
--env "PHP_OPTIONS_DATE_TIMEZONE=$(PHP_OPTIONS_DATE_TIMEZONE)" \
29+
--env "PHP_OPTIONS_SESSION_NAME=$(PHP_OPTIONS_SESSION_NAME)" \
2930
--env "PHP_OPTIONS_SESSION_SAVE_HANDLER=$(PHP_OPTIONS_SESSION_SAVE_HANDLER)" \
3031
--env "PHP_OPTIONS_SESSION_SAVE_PATH=$(PHP_OPTIONS_SESSION_SAVE_PATH)"
3132
endef

environment.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@ APACHE_SSL_CIPHER_SUITE ?= ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY
7272
APACHE_SSL_PROTOCOL ?= All -SSLv2 -SSLv3
7373
APACHE_SYSTEM_USER ?= app
7474
PHP_OPTIONS_DATE_TIMEZONE ?= UTC
75+
PHP_OPTIONS_SESSION_NAME ?= PHPSESSID
7576
PHP_OPTIONS_SESSION_SAVE_HANDLER ?= files
7677
PHP_OPTIONS_SESSION_SAVE_PATH ?= /var/lib/php/session

src/etc/systemd/system/centos-ssh-apache-php-fcgi@.service

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Environment="APACHE_SSL_CIPHER_SUITE=ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHA
7979
Environment="APACHE_SSL_PROTOCOL=All -SSLv2 -SSLv3"
8080
Environment="APACHE_SYSTEM_USER=app"
8181
Environment="PHP_OPTIONS_DATE_TIMEZONE=UTC"
82+
Environment="PHP_OPTIONS_SESSION_NAME=PHPSESSID"
8283
Environment="PHP_OPTIONS_SESSION_SAVE_HANDLER=files"
8384
Environment="PHP_OPTIONS_SESSION_SAVE_PATH=/var/lib/php/session"
8485

@@ -133,6 +134,7 @@ ExecStart=/bin/bash -c \
133134
--env \"APACHE_SSL_PROTOCOL=${APACHE_SSL_PROTOCOL}\" \
134135
--env \"APACHE_SYSTEM_USER=${APACHE_SYSTEM_USER}\" \
135136
--env \"PHP_OPTIONS_DATE_TIMEZONE=${PHP_OPTIONS_DATE_TIMEZONE}\" \
137+
--env \"PHP_OPTIONS_SESSION_NAME=${PHP_OPTIONS_SESSION_NAME}\" \
136138
--env \"PHP_OPTIONS_SESSION_SAVE_HANDLER=${PHP_OPTIONS_SESSION_SAVE_HANDLER}\" \
137139
--env \"PHP_OPTIONS_SESSION_SAVE_PATH=${PHP_OPTIONS_SESSION_SAVE_PATH}\" \
138140
$(if [[ ${DOCKER_PORT_MAP_TCP_80} != NULL ]]; then \

src/opt/scmi/environment.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ APACHE_SSL_CIPHER_SUITE="${APACHE_SSL_CIPHER_SUITE:-"ECDHE-ECDSA-CHACHA20-POLY13
7676
APACHE_SSL_PROTOCOL="${APACHE_SSL_PROTOCOL:-All -SSLv2 -SSLv3}"
7777
APACHE_SYSTEM_USER="${APACHE_SYSTEM_USER:-app}"
7878
PHP_OPTIONS_DATE_TIMEZONE="${PHP_OPTIONS_DATE_TIMEZONE:-UTC}"
79+
PHP_OPTIONS_SESSION_NAME="${PHP_OPTIONS_SESSION_NAME:-PHPSESSID}"
7980
PHP_OPTIONS_SESSION_SAVE_HANDLER="${PHP_OPTIONS_SESSION_SAVE_HANDLER:-files}"
8081
PHP_OPTIONS_SESSION_SAVE_PATH="${PHP_OPTIONS_SESSION_SAVE_PATH:-/var/lib/php/session}"

test/shpec/operation_shpec.sh

Lines changed: 109 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function __setup ()
8989
local -r session_store_alias="memcached_1"
9090
local -r session_store_name="memcached.pool-1.1.1"
9191
local -r session_store_network="bridge_internal_1"
92-
local -r session_store_release="1.1.1"
92+
local -r session_store_release="1.1.2"
9393

9494
if [[ -z $(docker network ls -q -f name="${session_store_network}") ]]; then
9595
docker network create \
@@ -222,6 +222,7 @@ ${other_required_apache_modules}
222222
local container_hostname=""
223223
local container_port_80=""
224224
local curl_get_request=""
225+
local curl_session_name=""
225226
local header_server=""
226227
local header_x_service_uid=""
227228
local status=0
@@ -631,6 +632,25 @@ ${other_required_apache_modules}
631632
end
632633
end
633634

635+
describe "PHP options"
636+
it "Has default session.name."
637+
curl_session_name="$(
638+
curl -s \
639+
--header 'Host: localhost.localdomain' \
640+
http://127.0.0.1:${container_port_80}/_phpinfo.php \
641+
| grep 'session.name' \
642+
| sed -E \
643+
-e 's~^.*(session.name)~\1~' \
644+
-e 's~</t(r|d)>~~g' \
645+
-e 's~<td[^>]*>~ ~g'
646+
)"
647+
648+
assert equal \
649+
"${curl_session_name}" \
650+
"session.name PHPSESSID PHPSESSID"
651+
end
652+
end
653+
634654
__terminate_container \
635655
apache-php.pool-1.1.1 \
636656
&> /dev/null
@@ -663,6 +683,7 @@ function test_custom_configuration ()
663683
local curl_response_code_server_alias=""
664684
local curl_session_data_write=""
665685
local curl_session_data_read=""
686+
local curl_session_name=""
666687
local header_x_service_operating_mode=""
667688
local header_x_service_uid=""
668689
local php_date_timezone=""
@@ -2010,43 +2031,6 @@ function test_custom_configuration ()
20102031
end
20112032
end
20122033

2013-
describe "PHP date.timezone"
2014-
it "Sets to 'Europe/London'."
2015-
__terminate_container \
2016-
apache-php.pool-1.1.1 \
2017-
&> /dev/null
2018-
2019-
docker run \
2020-
--detach \
2021-
--name apache-php.pool-1.1.1 \
2022-
--publish ${DOCKER_PORT_MAP_TCP_80}:80 \
2023-
--env PHP_OPTIONS_DATE_TIMEZONE="Europe/London" \
2024-
jdeathe/centos-ssh-apache-php-fcgi:latest \
2025-
&> /dev/null
2026-
2027-
if ! __is_container_ready \
2028-
apache-php.pool-1.1.1 \
2029-
${STARTUP_TIME} \
2030-
"/usr/sbin/httpd(\.worker|\.event)? " \
2031-
"[[ 000 != \$(curl -sI -o /dev/null -w %{http_code} localhost/) ]]"
2032-
then
2033-
exit 1
2034-
fi
2035-
2036-
php_date_timezone="$(
2037-
docker exec \
2038-
apache-php.pool-1.1.1 \
2039-
php \
2040-
-r \
2041-
"printf('%s', ini_get('date.timezone'));"
2042-
)"
2043-
2044-
assert equal \
2045-
"${php_date_timezone}" \
2046-
"Europe/London"
2047-
end
2048-
end
2049-
20502034
describe "Configure autostart"
20512035
__terminate_container \
20522036
apache-php.pool-1.1.1 \
@@ -2107,6 +2091,93 @@ function test_custom_configuration ()
21072091
&> /dev/null
21082092
end
21092093

2094+
describe "PHP date.timezone"
2095+
it "Sets to 'Europe/London'."
2096+
__terminate_container \
2097+
apache-php.pool-1.1.1 \
2098+
&> /dev/null
2099+
2100+
docker run \
2101+
--detach \
2102+
--name apache-php.pool-1.1.1 \
2103+
--publish ${DOCKER_PORT_MAP_TCP_80}:80 \
2104+
--env PHP_OPTIONS_DATE_TIMEZONE="Europe/London" \
2105+
jdeathe/centos-ssh-apache-php-fcgi:latest \
2106+
&> /dev/null
2107+
2108+
if ! __is_container_ready \
2109+
apache-php.pool-1.1.1 \
2110+
${STARTUP_TIME} \
2111+
"/usr/sbin/httpd(\.worker|\.event)? " \
2112+
"[[ 000 != \$(curl -sI -o /dev/null -w %{http_code} localhost/) ]]"
2113+
then
2114+
exit 1
2115+
fi
2116+
2117+
php_date_timezone="$(
2118+
docker exec \
2119+
apache-php.pool-1.1.1 \
2120+
php \
2121+
-r \
2122+
"printf('%s', ini_get('date.timezone'));"
2123+
)"
2124+
2125+
assert equal \
2126+
"${php_date_timezone}" \
2127+
"Europe/London"
2128+
end
2129+
end
2130+
2131+
describe "PHP session.name"
2132+
__terminate_container \
2133+
apache-php.pool-1.1.1 \
2134+
&> /dev/null
2135+
2136+
docker run \
2137+
--detach \
2138+
--name apache-php.pool-1.1.1 \
2139+
--publish ${DOCKER_PORT_MAP_TCP_80}:80 \
2140+
--env PHP_OPTIONS_SESSION_NAME="app-session" \
2141+
jdeathe/centos-ssh-apache-php:latest \
2142+
&> /dev/null
2143+
2144+
if ! __is_container_ready \
2145+
apache-php.pool-1.1.1 \
2146+
${STARTUP_TIME} \
2147+
"/usr/sbin/httpd(\.worker|\.event)? " \
2148+
"[[ 000 != \$(curl -sI -o /dev/null -w %{http_code} localhost/) ]]"
2149+
then
2150+
exit 1
2151+
fi
2152+
2153+
container_port_80="$(
2154+
__get_container_port \
2155+
apache-php.pool-1.1.1 \
2156+
80/tcp
2157+
)"
2158+
2159+
it "Sets to app-session."
2160+
curl_session_name="$(
2161+
curl -s \
2162+
--header 'Host: localhost.localdomain' \
2163+
http://127.0.0.1:${container_port_80}/_phpinfo.php \
2164+
| grep 'session.name' \
2165+
| sed -E \
2166+
-e 's~^.*(session.name)~\1~' \
2167+
-e 's~</t(r|d)>~~g' \
2168+
-e 's~<td[^>]*>~ ~g'
2169+
)"
2170+
2171+
assert equal \
2172+
"${curl_session_name}" \
2173+
"session.name app-session app-session"
2174+
end
2175+
2176+
__terminate_container \
2177+
apache-php.pool-1.1.1 \
2178+
&> /dev/null
2179+
end
2180+
21102181
describe "PHP memcached session store"
21112182
__terminate_container \
21122183
apache-php.pool-1.1.1 \

0 commit comments

Comments
 (0)