Compare commits

...
Author SHA1 Message Date
AlkorZ3 1ad3205db3 - Add mod_ssl to support https reverse proxy,
- Add proto arg to Proxy_Ext, Proxy_Int & Proxy_Ext_Int macros (Warning: Interface break!),
- Now use rx3-docker/server:1.4.1-mga9 image (Rx3 CA support).
2026-10-31 19:10:05 +01:00
AlkorZ3 97480f993b - Add PHP_DISABLED_FUNCTIONS environment variable. 2026-10-26 11:34:50 +01:00
5 changed files with 56 additions and 17 deletions

No files matched your search

+25 -13
View File
@@ -46,6 +46,7 @@ done
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/post_max_size = 8M/post_max_size = ${PHP_UPLOAD_LIMIT}/" /etc/php.d/01_datahandling.ini \n\
sed -i -e "s/disable_functions =/disable_functions = ${PHP_DISABLED_FUNCTIONS}/" /etc/php.d/01_language.ini \n\
\n\
# HTTPD enabled by default \n\
if [[ "${APACHE_HTTPD_ENABLED}" == "FALSE" ]] \n\
@@ -73,7 +74,7 @@ ARG HTTPD_CONF='#---------------------------------------------------------------
# prefix_int should be formated as: "", "aaa/" or "aaa/bbb/"... \n\
#------------------------------------------------------------------------------- \n\
\n\
<Macro _Proxy $prefix_ext $prefix_int $host $port> \n\
<Macro _Proxy $prefix_ext $prefix_int $proto $host $port> \n\
\n\
RewriteCond "`$prefix_ext`" "!= ``" \n\
RewriteRule "^/$prefix_ext$" "/$prefix_ext/" [R,L] \n\
@@ -81,8 +82,16 @@ ARG HTTPD_CONF='#---------------------------------------------------------------
<Location /$prefix_ext/> \n\
Require all granted \n\
\n\
ProxyPass http://$host:$port/$prefix_int flushpackets=on nocanon \n\
ProxyPassReverse http://$host:$port/$prefix_int \n\
ProxyPass $proto://$host:$port/$prefix_int flushpackets=on nocanon \n\
ProxyPassReverse $proto://$host:$port/$prefix_int \n\
\n\
# PreserveHost \n\
<If "`$proto` == `https`"> \n\
ProxyPreserveHost Off \n\
</If> \n\
<Else> \n\
ProxyPreserveHost On \n\
</Else> \n\
\n\
# CookiePath Mapping \n\
<If "`$prefix_int` != ``"> \n\
@@ -104,7 +113,7 @@ ARG HTTPD_CONF='#---------------------------------------------------------------
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\
Header edit* Location ^($proto://[^/]+)/(?!$prefix_ext/)(.*)$ $1/$prefix_ext/$2 \n\
\n\
# Fix relative Location headers (starting with /) \n\
Header edit* Location ^/(?!$prefix_ext/)(.*)$ /$prefix_ext/$1 \n\
@@ -120,16 +129,16 @@ ARG HTTPD_CONF='#---------------------------------------------------------------
# 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 Proxy_Ext $prefix_ext $proto $host $port> \n\
Use _Proxy $prefix_ext "" $proto $host $port \n\
</Macro> \n\
\n\
<Macro Proxy_Int $prefix_ext $prefix_int $host $port> \n\
Use _Proxy "" $prefix_int/ $host $port \n\
<Macro Proxy_Int $prefix_ext $prefix_int $proto $host $port> \n\
Use _Proxy "" $prefix_int/ $proto $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 Proxy_Ext_Int $prefix_ext $prefix_int $proto $host $port> \n\
Use _Proxy $prefix_ext $prefix_int/ $proto $host $port \n\
</Macro> \n\
\n\
\n\
@@ -138,10 +147,12 @@ RewriteEngine On
\n\
# Reverse Proxy Configuration \n\
ProxyRequests Off \n\
ProxyPreserveHost On \n\
AllowEncodedSlashes NoDecode \n\
\n\
\n\
# SSL Reverse Proxy Configuration \n\
SSLProxyEngine On \n\
SSLProxyVerify require \n\
SSLProxyCACertificateFile /etc/pki/tls/certs/ca-bundle.crt \n\
\n\
<Directory /var/www/html> \n\
Options Includes Indexes FollowSymLinks \n\
@@ -163,8 +174,9 @@ ARG INFO_PHP='<?php
RUN . /etc/profile.d/rx3.sh && isl --add ${IMG_URL} \
&& 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_ssl 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%^Listen 443%#Listen 443%" /etc/httpd/conf/conf.d/ssl.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 \
&& mkdir /etc/httpd/conf/sites.d/default_vhost.d \
+4 -2
View File
@@ -5,17 +5,19 @@ Welcome to Rx3-Docker/PHP-Apache docker image!
This project aims to build a PHP + Apache docker image used by other Rx3 packaging projects.
Features:
- Curtently based on rx3-docker/server:1.4.0-mga9 image,
- Currently based on rx3-docker/server:1.4.1-mga9 image,
- default_vhost.d layout support,
- PostgreSQL & MySQL ready,
- PHPMailer installed,
- logrotate configured,
- Apache UID, GID & document root directory configurable,
- mod_proxy + mod_proxy_html installed,
- md_ssl installed (to support ssl proxy) with Rx3 CA support,
- Proxy Apache macro,
- HTTPD service enabled by default (APACHE_HTTPD_ENABLED),
- 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,
- PHP_DISABLED_FUNCTIONS support.
+18
View File
@@ -1,3 +1,21 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.7.3 - A. GIBERT - 2026/10/31
------------------------------------------------------------------------------------------------------------------------------------
- Add mod_ssl to support https reverse proxy,
- Add proto arg to Proxy_Ext, Proxy_Int & Proxy_Ext_Int macros (Warning: Interface break!),
- Now use rx3-docker/server:1.4.1-mga9 image (Rx3 CA support).
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.7.2 - A. GIBERT - 2026/10/26
------------------------------------------------------------------------------------------------------------------------------------
- Add PHP_DISABLED_FUNCTIONS environment variable.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.7.1 - A. GIBERT - 2026/10/21
------------------------------------------------------------------------------------------------------------------------------------
+2
View File
@@ -29,12 +29,14 @@ services:
restart: unless-stopped
environment:
SERVER_CROND_ENABLED: ${WA_SERVER_CROND_ENABLED}
APACHE_UID: ${WA_USER_ID}
APACHE_GID: ${WA_GROUP_ID}
APACHE_DOC_ROOT: ${WA_DOC_ROOT}
APACHE_HTTPD_ENABLED: ${WA_APACHE_HTTPD_ENABLED}
PHP_MEMORY_LIMIT: ${WA_PHP_MEMORY_LIMIT}
PHP_UPLOAD_LIMIT: ${WA_PHP_UPLOAD_LIMIT}
PHP_DISABLED_FUNCTIONS: ${WA_PHP_DISABLED_FUNCTIONS}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${WA_PORT_MAIN_INT}"]
+7 -2
View File
@@ -39,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 |
#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+-----------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
docker_service_add WA webapp ${ORG_URL_PREFIX} php-apache "Rx3-Docker/PHP-Apache" 1.7.1-mga9 ${ORG_URL_PREFIX} server 1.4.0-mga9 httpd - 8080 80 - - apache apache
docker_service_add WA webapp ${ORG_URL_PREFIX} php-apache "Rx3-Docker/PHP-Apache" 1.7.3-mga9 ${ORG_URL_PREFIX} server 1.4.1-mga9 httpd - 8080 80 - - apache apache
@@ -47,9 +47,14 @@ docker_service_add WA webapp ${ORG_URL_PREFIX}
# User Settings
#-------------------------------------------------------------------------------
SERVER_CROND_ENABLED="FALSE"
WA_SERVER_CROND_ENABLED="FALSE"
WA_DOC_ROOT="/var/www/html"
WA_APACHE_HTTPD_ENABLED="TRUE"
WA_PHP_MEMORY_LIMIT="512M"
WA_PHP_UPLOAD_LIMIT="32M"
#WA_PHP_DISABLED_FUNCTIONS="phpinfo"
WA_PHP_DISABLED_FUNCTIONS=""