- Replace SupervisorProxy macro with more generic macros: Proxy_Ext, Proxy_Int & Proxy_Ext_Int.
This commit is contained in:
204
Dockerfile
204
Dockerfile
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.3.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.
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
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
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
2
env.dist
2
env.dist
@@ -38,7 +38,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.6.3-mga9 ${ORG_URL_PREFIX} server 1.3.0-mga9 httpd - 8080 80 - - apache apache
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user