2 Commits

Author SHA1 Message Date
5a79b87b01 - Now use rx3-docker/server:1.4.0-mga9 image,
- Now use docker-tools-1.5.2,
- Rebuild for updates.
2026-05-30 11:53:07 +02:00
3459974e5c - Replace SupervisorProxy macro with more generic macros: Proxy_Ext, Proxy_Int & Proxy_Ext_Int. 2026-03-01 20:24:47 +01:00
4 changed files with 164 additions and 81 deletions

View File

@@ -24,92 +24,156 @@ ARG HTTPD_CONF_FILE=/etc/httpd/conf/sites.d/default_vhost.d/30-rx3.conf
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG HTTPD='#!/bin/bash \n\ ARG HTTPD='#!/bin/bash \n\
\n\ \n\
[[ "${APACHE_UID}" != "" ]] && usermod -u ${APACHE_UID} apache \n\ [[ "${APACHE_UID}" != "" ]] && usermod -u ${APACHE_UID} apache \n\
[[ "${APACHE_GID}" != "" ]] && groupmod -g ${APACHE_GID} apache \n\ [[ "${APACHE_GID}" != "" ]] && groupmod -g ${APACHE_GID} apache \n\
\n\ \n\
chgrp apache /usr/bin/pwauth \n\ chgrp apache /usr/bin/pwauth \n\
chmod u+s /usr/bin/pwauth \n\ chmod u+s /usr/bin/pwauth \n\
\n\ \n\
chown -R apache:apache /var/log/httpd \n\ chown -R apache:apache /var/log/httpd \n\
\n\ \n\
for file in /etc/httpd/conf/httpd.conf '${HTTPD_CONF_FILE}' \n\ for file in /etc/httpd/conf/httpd.conf '${HTTPD_CONF_FILE}' \n\
do \n\ do \n\
sed -i -e "s%/var/www/html%${APACHE_DOC_ROOT}%" ${file} \n\ sed -i -e "s%/var/www/html%${APACHE_DOC_ROOT}%" ${file} \n\
done \n\ done \n\
\n\ \n\
[[ "${PHP_MEMORY_LIMIT}" == "" ]] && PHP_MEMORY_LIMIT="512M" \n\ [[ "${PHP_MEMORY_LIMIT}" == "" ]] && PHP_MEMORY_LIMIT="512M" \n\
[[ "${PHP_UPLOAD_LIMIT}" == "" ]] && PHP_UPLOAD_LIMIT="32M" \n\ [[ "${PHP_UPLOAD_LIMIT}" == "" ]] && PHP_UPLOAD_LIMIT="32M" \n\
\n\ \n\
sed -i -e "s/memory_limit = 128M/memory_limit = ${PHP_MEMORY_LIMIT}/" /etc/php.d/01_ressourcelimits.ini \n\ sed -i -e "s/memory_limit = 128M/memory_limit = ${PHP_MEMORY_LIMIT}/" /etc/php.d/01_ressourcelimits.ini \n\
sed -i -e "s/upload_max_filesize = 16M/upload_max_filesize = ${PHP_UPLOAD_LIMIT}/" /etc/php.d/01_fileuploads.ini \n\ sed -i -e "s/upload_max_filesize = 16M/upload_max_filesize = ${PHP_UPLOAD_LIMIT}/" /etc/php.d/01_fileuploads.ini \n\
sed -i -e "s/post_max_size = 8M/post_max_size = ${PHP_UPLOAD_LIMIT}/" /etc/php.d/01_datahandling.ini \n\ sed -i -e "s/post_max_size = 8M/post_max_size = ${PHP_UPLOAD_LIMIT}/" /etc/php.d/01_datahandling.ini \n\
\n\ \n\
# HTTPD enabled by default \n\ # HTTPD enabled by default \n\
if [[ "${APACHE_HTTPD_ENABLED}" == "FALSE" ]] \n\ if [[ "${APACHE_HTTPD_ENABLED}" == "FALSE" ]] \n\
then \n\ then \n\
file_enable /etc/supervisord.d/httpd.ini FALSE \n\ file_enable /etc/supervisord.d/httpd.ini FALSE \n\
else \n\ else \n\
file_enable /etc/supervisord.d/httpd.ini TRUE \n\ file_enable /etc/supervisord.d/httpd.ini TRUE \n\
fi' fi'
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG HTTPD_INI='[program:httpd] \n\ ARG HTTPD_INI='[program:httpd] \n\
command=/usr/sbin/httpd -DFOREGROUND' command=/usr/sbin/httpd -DFOREGROUND'
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG HTTPD_CONF='<Macro SupervisorProxy $prefix $host $port> \n\ ARG HTTPD_CONF='#------------------------------------------------------------------------------- \n\
RewriteRule "^/$prefix$" "/$refix/" [R] \n\ # _Proxy (Internal Macro) \n\
\n\ #------------------------------------------------------------------------------- \n\
<Location /$prefix/> \n\ # Warning: prefix_ext should be formated as: "", "aaa" or "aaa/bbb"... \n\
ProxyPass http://$host:$port/ \n\ # prefix_int should be formated as: "", "aaa/" or "aaa/bbb/"... \n\
ProxyPassReverse http://$host:$port/ \n\ #------------------------------------------------------------------------------- \n\
\n\ \n\
Header edit* Location ^(https?://[^/]+)/(?!$prefix/)(.*)$ $1/$prefix/index.html$2 \n\ <Macro _Proxy $prefix_ext $prefix_int $host $port> \n\
</Location> \n\ \n\
</Macro> \n\ RewriteCond "`$prefix_ext`" "!= ``" \n\
\n\ RewriteRule "^/$prefix_ext$" "/$prefix_ext/" [R,L] \n\
RewriteEngine On \n\ \n\
\n\ <Location /$prefix_ext/> \n\
<Directory /var/www/html> \n\ Require all granted \n\
Options Includes Indexes FollowSymLinks \n\ \n\
AllowOverride All \n\ ProxyPass http://$host:$port/$prefix_int flushpackets=on nocanon \n\
Require all granted \n\ ProxyPassReverse http://$host:$port/$prefix_int \n\
\n\
# CookiePath Mapping \n\
<If "`$prefix_int` != ``"> \n\
<If "`$prefix_ext` != ``"> \n\
ProxyPassReverseCookiePath /$prefix_int /$prefix_ext/ \n\
</If> \n\
<Else> \n\
ProxyPassReverseCookiePath /$prefix_int / \n\
</Else> \n\
</If> \n\
<ElseIf "`$prefix_ext` != ``"> \n\
ProxyPassReverseCookiePath / /$prefix_ext/ \n\
</ElseIf> \n\
\n\
# Header Normalization \n\
RequestHeader setifempty X-Forwarded-Proto expr=%{REQUEST_SCHEME} \n\
\n\
<If "`$prefix_ext` != ``"> \n\
RequestHeader setifempty X-Forwarded-Prefix "/$prefix_ext" \n\
\n\
# Fix absolute Location headers (with domain) \n\
Header edit* Location ^(https?://[^/]+)/(?!$prefix_ext/)(.*)$ $1/$prefix_ext/$2 \n\
\n\
# Fix relative Location headers (starting with /) \n\
Header edit* Location ^/(?!$prefix_ext/)(.*)$ /$prefix_ext/$1 \n\
</If> \n\
</Location> \n\
</Macro> \n\
\n\
\n\
\n\
#------------------------------------------------------------------------------- \n\
# Proxy_Ext / Proxy_Int / Proxy_Ext_Int \n\
#------------------------------------------------------------------------------- \n\
# Warning: prefix_* should be formated as: "", "aaa" or "aaa/bbb"... \n\
#------------------------------------------------------------------------------- \n\
\n\
<Macro Proxy_Ext $prefix_ext $host $port> \n\
Use _Proxy $prefix_ext "" $host $port \n\
</Macro> \n\
\n\
<Macro Proxy_Int $prefix_ext $prefix_int $host $port> \n\
Use _Proxy "" $prefix_int/ $host $port \n\
</Macro> \n\
\n\
<Macro Proxy_Ext_Int $prefix_ext $prefix_int $host $port> \n\
Use _Proxy $prefix_ext $prefix_int/ $host $port \n\
</Macro> \n\
\n\
\n\
\n\
RewriteEngine On \n\
\n\
# Reverse Proxy Configuration \n\
ProxyRequests Off \n\
ProxyPreserveHost On \n\
AllowEncodedSlashes NoDecode \n\
\n\
\n\
\n\
<Directory /var/www/html> \n\
Options Includes Indexes FollowSymLinks \n\
AllowOverride All \n\
Require all granted \n\
</Directory>' </Directory>'
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG INFO_PHP='<?php \n\ ARG INFO_PHP='<?php \n\
phpinfo(); \n\ phpinfo(); \n\
phpinfo( INFO_MODULES); \n\ phpinfo( INFO_MODULES); \n\
?>' ?>'
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RUN . /etc/profile.d/rx3.sh && isl_add ${IMG_URL} \ RUN . /etc/profile.d/rx3.sh && isl --add ${IMG_URL} \
&& urpmi.update -a \ && urpmi.update -a \
&& urpmi --force apache apache-mod_proxy apache-mod_proxy_html apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer pwauth \ && urpmi --force apache apache-mod_proxy apache-mod_proxy_html apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer pwauth \
&& sed -i -e "s%#LoadModule macro_module modules/mod_macro.so%LoadModule macro_module modules/mod_macro.so%" /etc/httpd/conf/modules.d/00_base.conf \ && sed -i -e "s%#LoadModule macro_module modules/mod_macro.so%LoadModule macro_module modules/mod_macro.so%" /etc/httpd/conf/modules.d/00_base.conf \
&& mv /etc/httpd/conf/sites.d/00_default_vhosts.conf /etc/httpd/conf/sites.d/00-default_vhost.conf \ && mv /etc/httpd/conf/sites.d/00_default_vhosts.conf /etc/httpd/conf/sites.d/00-default_vhost.conf \
&& sed -i -e "s%ServerName localhost%ServerName localhost\n\n Include conf/sites.d/default_vhost.d/*.conf%" /etc/httpd/conf/sites.d/00-default_vhost.conf \ && sed -i -e "s%ServerName localhost%ServerName localhost\n\n Include conf/sites.d/default_vhost.d/*.conf%" /etc/httpd/conf/sites.d/00-default_vhost.conf \
&& mkdir /etc/httpd/conf/sites.d/default_vhost.d \ && mkdir /etc/httpd/conf/sites.d/default_vhost.d \
&& rm -f /var/log/README \ && rm -f /var/log/README \
&& echo -e "${HTTPD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/httpd \ && echo -e "${HTTPD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/httpd \
&& chmod a+x /etc/init.d/httpd \ && chmod a+x /etc/init.d/httpd \
&& ln -s /etc/init.d/httpd /etc/rcD.d/S30httpd \ && ln -s /etc/init.d/httpd /etc/rcD.d/S30httpd \
&& echo -e "${HTTPD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/httpd.ini \ && echo -e "${HTTPD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/httpd.ini \
&& echo -e "${HTTPD_CONF}" | sed -e "s/\`/'/g" -e 's/ *$//' > ${HTTPD_CONF_FILE} \ && echo -e "${HTTPD_CONF}" | sed -e "s/\`/'/g" -e 's/ *$//' > ${HTTPD_CONF_FILE} \
&& echo -e "${INFO_PHP}" | sed -e "s/\`/'/g" -e 's/ *$//' > /var/www/html/info.php && echo -e "${INFO_PHP}" | sed -e "s/\`/'/g" -e 's/ *$//' > /var/www/html/info.php

View File

@@ -5,14 +5,14 @@ Welcome to Rx3-Docker/PHP-Apache docker image!
This project aims to build a PHP + Apache docker image used by other Rx3 packaging projects. This project aims to build a PHP + Apache docker image used by other Rx3 packaging projects.
Features: Features:
- Curtently based on rx3-docker/server:1.2.7-mga9 image, - Curtently based on rx3-docker/server:1.4.0-mga9 image,
- default_vhost.d layout support, - default_vhost.d layout support,
- PostgreSQL & MySQL ready, - PostgreSQL & MySQL ready,
- PHPMailer installed, - PHPMailer installed,
- logrotate configured, - logrotate configured,
- Apache UID, GID & document root directory configurable, - Apache UID, GID & document root directory configurable,
- mod_proxy + mod_proxy_html installed, - mod_proxy + mod_proxy_html installed,
- SupervisorProxy Apache macro, - Proxy Apache macro,
- HTTPD service enabled by default (APACHE_HTTPD_ENABLED), - HTTPD service enabled by default (APACHE_HTTPD_ENABLED),
- PHP_MEMORY_LIMIT variable set to 512M by default, - PHP_MEMORY_LIMIT variable set to 512M by default,
- PHP_UPLOAD_LIMIT variable set to 32M by defaylt. - PHP_UPLOAD_LIMIT variable set to 32M by defaylt.

View File

@@ -1,9 +1,27 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.7.0 - A. GIBERT - 2026/05/30
------------------------------------------------------------------------------------------------------------------------------------
- Now use rx3-docker/server:1.4.0-mga9 image,
- Now use docker-tools-1.5.2,
- Rebuild for updates.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.6.3 - A. GIBERT - 2026/03/01
------------------------------------------------------------------------------------------------------------------------------------
- Replace SupervisorProxy macro with more generic macros: Proxy_Ext, Proxy_Int & Proxy_Ext_Int.
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.6.2 - A. GIBERT - 2026/02/16 Rx3-Docker/PHP-Apache V 1.6.2 - A. GIBERT - 2026/02/16
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
- Add ISL support, - Add ISL support,
- Use now rx3-docker/server:1.3.0-mga9 image, - Now Use rx3-docker/server:1.3.0-mga9 image,
- Fix rx3.conf file renaming bug. - Fix rx3.conf file renaming bug.
- Rebuild for updates. - Rebuild for updates.
@@ -26,7 +44,7 @@ Rx3-Docker/PHP-Apache V 1.6.0 - A. GIBERT - 2025/12/01
- Switch to new default_vhost.d layout, - Switch to new default_vhost.d layout,
- Fix error when APACHE_UID / APACHE_GID not provided, - Fix error when APACHE_UID / APACHE_GID not provided,
- Perform HTTPD initialisation even when not activated, - Perform HTTPD initialisation even when not activated,
- Use now rx3-docker/server:1.2.7-mga9 image, - Now use rx3-docker/server:1.2.7-mga9 image,
- Rebuild for updates. - Rebuild for updates.
@@ -35,7 +53,7 @@ Rx3-Docker/PHP-Apache V 1.6.0 - A. GIBERT - 2025/12/01
Rx3-Docker/PHP-Apache V 1.5.4 - A. GIBERT - 2025/09/19 Rx3-Docker/PHP-Apache V 1.5.4 - A. GIBERT - 2025/09/19
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
- Use now rx3-docker/server:1.2.6-mga9 image, - Now use rx3-docker/server:1.2.6-mga9 image,
- Rebuild for updates. - Rebuild for updates.
@@ -44,7 +62,7 @@ Rx3-Docker/PHP-Apache V 1.5.4 - A. GIBERT - 2025/09/19
Rx3-Docker/PHP-Apache V 1.5.3 - A. GIBERT - 2025/04/21 Rx3-Docker/PHP-Apache V 1.5.3 - A. GIBERT - 2025/04/21
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
- Use now rx3-docker/server:1.2.2-mga9 image. - Now use rx3-docker/server:1.2.2-mga9 image.
@@ -53,7 +71,7 @@ Rx3-Docker/PHP-Apache V 1.5.2 - A. GIBERT - 2025/03/08
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
- Add PHP_MEMORY_LIMIT & PHP_UPLOAD_LIMIT environment variable, - Add PHP_MEMORY_LIMIT & PHP_UPLOAD_LIMIT environment variable,
- Use now rx3-docker/server:1.2.1-mga9 image. - Now use rx3-docker/server:1.2.1-mga9 image.
@@ -80,7 +98,7 @@ Rx3-Docker/PHP-Apache V 1.4.0 - A. GIBERT - 2024/11/11
- Move & Rename repo from Rx3/PHP-Apache-MGA9 to Rx3-Docker/PHP-Apache, - Move & Rename repo from Rx3/PHP-Apache-MGA9 to Rx3-Docker/PHP-Apache,
- New version naming standard, - New version naming standard,
- Now use docker_tools for .env building, - Now use docker_tools for .env building,
- Use now rx3-docker/server:1.2.0-mga9 image, - Now use rx3-docker/server:1.2.0-mga9 image,
- Add /var/log/init, /var/log/supervisor & var/log/httpd volumes. - Add /var/log/init, /var/log/supervisor & var/log/httpd volumes.
@@ -97,7 +115,7 @@ Rx3/PHP-Apache-Mga9 V 1.3.3 - A. GIBERT - 2024/10/05
- post_max_size from 8M to 32M, - post_max_size from 8M to 32M,
- Don't expose unneeded /var/www/html in compose file, - Don't expose unneeded /var/www/html in compose file,
- Variabilization of external server ports in env & compose file, - Variabilization of external server ports in env & compose file,
- Use now docker_tools for .env building. - Now use docker_tools for .env building.

View File

@@ -5,7 +5,6 @@
# Global Settings # Global Settings
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
ORG_NAME="rx3-docker" ORG_NAME="rx3-docker"
ORG_REGISTRY="docker.xor.rx3:5000" ORG_REGISTRY="docker.xor.rx3:5000"
ORG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>' ORG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
@@ -17,6 +16,8 @@ ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Image Settings # Image Settings
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
APPL_NAME=""
HOST_NAME_PREFIX="" HOST_NAME_PREFIX=""
PORT_ENV_OFFSET=0 PORT_ENV_OFFSET=0
@@ -38,7 +39,7 @@ DOCKER_TOOLS_EXEPTION_LIBS="httpd:/var/www/html"
# | Prefix | Name | URL Prefix | Name | Name Full | Version | URL Prefix | Name | Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id | # | Prefix | Name | URL Prefix | Name | Name Full | Version | URL Prefix | Name | Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id |
#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+-----------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+ #------------------+----------+--------------------------+--------------------+------------------+-------------------------------+-----------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
docker_service_add WA webapp ${ORG_URL_PREFIX} php-apache "Rx3-Docker/PHP-Apache" 1.6.2-mga9 ${ORG_URL_PREFIX} server 1.3.0-mga9 httpd - 8080 80 - - apache apache docker_service_add WA webapp ${ORG_URL_PREFIX} php-apache "Rx3-Docker/PHP-Apache" 1.7.0-mga9 ${ORG_URL_PREFIX} server 1.4.0-mga9 httpd - 8080 80 - - apache apache