diff --git a/.devilbox/www/config.php b/.devilbox/www/config.php index 38f67ebbf..2c4cc582c 100644 --- a/.devilbox/www/config.php +++ b/.devilbox/www/config.php @@ -13,8 +13,8 @@ putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); -$DEVILBOX_VERSION = 'v2.4.0'; -$DEVILBOX_DATE = '2022-12-18'; +$DEVILBOX_VERSION = 'v3.0.0-beta-0.1'; +$DEVILBOX_DATE = '2022-12-24'; $DEVILBOX_API_PAGE = 'devilbox-api/status.json'; // diff --git a/.devilbox/www/htdocs/cnc.php b/.devilbox/www/htdocs/cnc.php new file mode 100644 index 000000000..2a78c7cf2 --- /dev/null +++ b/.devilbox/www/htdocs/cnc.php @@ -0,0 +1,179 @@ + +authPage(); ?> +exec('supervisorctl -c ' . $supervisor_config_file . ' ' . $command); +} + + +?> +redirect('/cnc.php'); +} +?> + + + + getHead(true); ?> + + + + getNavbar(); ?> + +
+

Command & Control

+
+
+ +
+
+ + isset($words[0]) ? $words[0] : '', + 'state' => isset($words[1]) ? $words[1] : '', + 'pid' => isset($words[3]) ? preg_replace('/,$/', '', $words[3]) : '', + 'uptime' => isset($words[5]) ? $words[5] : '', + ); + $words = preg_split("/\s+/", $status_h); + $data_h = array( + 'name' => isset($words[0]) ? $words[0] : '', + 'state' => isset($words[1]) ? $words[1] : '', + 'pid' => isset($words[3]) ? preg_replace('/,$/', '', $words[3]) : '', + 'uptime' => isset($words[5]) ? $words[5] : '', + ); + ?> +

Daemon overview


+

If you made a change to any vhost settings, you can trigger a manual reload here.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
DaemonStatusPidUptimeAction
+
+
+ +

watcherd stderr

+
+ '; + foreach(preg_split("/((\r?\n)|(\r\n?))/", $output) as $line) { + if ( strpos($line, "[ERR]") !== false ) { + echo '' . $line . ''; + } else if ( strpos($line, "[emerg]") !== false ) { + echo '' . $line . ''; + } else if ( strpos($line, "Syntax error") !== false ) { + echo '' . $line . ''; + } else if ( strpos($line, "[WARN]") !== false ) { + echo '' . $line . ''; + } else { + echo $line; + } + echo "\n"; + } + echo ''; + ?> +

watcherd stdout

+
+ '; + foreach(preg_split("/((\r?\n)|(\r\n?))/", $output) as $line) { + $pos_info = strpos($line, "[INFO]"); + $pos_ok = strpos($line, "[OK]"); + if ( $pos_ok !== false ) { + echo '' . $line . ''; + } else if ( $pos_info !== false && $pos_info == 0 ) { + echo '' . $line . ''; + } else { + echo $line; + } + echo "\n"; + } + echo ''; + ?> + +
+
+ +
+ + getFooter(); ?> + + + diff --git a/.devilbox/www/htdocs/mail.php b/.devilbox/www/htdocs/mail.php index 21dc6990c..50e73b320 100644 --- a/.devilbox/www/htdocs/mail.php +++ b/.devilbox/www/htdocs/mail.php @@ -250,7 +250,7 @@ $.get('?get-body=' + id, function(response){ response = JSON.parse(response); row.find('.raw-email-body').html(response.raw); - + const body = response.body; if(body === null){ row.find('.alert').show(); diff --git a/.devilbox/www/htdocs/vhosts.php b/.devilbox/www/htdocs/vhosts.php index 89881992e..03590772f 100644 --- a/.devilbox/www/htdocs/vhosts.php +++ b/.devilbox/www/htdocs/vhosts.php @@ -24,6 +24,7 @@ Project DocumentRoot + Backend Config Valid URL @@ -31,7 +32,7 @@ getEnv('HOST_PATH_HTTPD_DATADIR');?>//getEnv('HTTPD_DOCROOT_DIR');?> + getVhostBackend($vHost['name']); ?> getVhostgenTemplatePath($vHost['name'])) !== false): ?> diff --git a/.devilbox/www/include/lib/Html.php b/.devilbox/www/include/lib/Html.php index 5a78174ca..8ec66c9ab 100644 --- a/.devilbox/www/include/lib/Html.php +++ b/.devilbox/www/include/lib/Html.php @@ -18,6 +18,10 @@ class Html 'name' => 'Virtual Hosts', 'path' => '/vhosts.php' ), + array( + 'name' => 'C&C', + 'path' => '/cnc.php' + ), array( 'name' => 'Emails', 'path' => '/mail.php' diff --git a/.devilbox/www/include/lib/container/Httpd.php b/.devilbox/www/include/lib/container/Httpd.php index 7813ec851..1d52bd288 100644 --- a/.devilbox/www/include/lib/container/Httpd.php +++ b/.devilbox/www/include/lib/container/Httpd.php @@ -196,6 +196,33 @@ public function getVhostgenTemplatePath($vhost) return false; } + public function getVhostBackend($vhost) + { + $dir = loadClass('Helper')->getEnv('HTTPD_TEMPLATE_DIR'); + $name = 'backend.cfg'; + $file = '/shared/httpd/'.$vhost.'/'.$dir.'/'.$name; + if (!file_exists($file)) { + return 'default'; + } + + $fp = fopen($file, 'r'); + $cont = stream_get_contents($fp); + fclose($fp); + + // conf:::: + $arr = explode(':', $cont); + + $type = $arr[1]; + $prot = $arr[2]; + $addr = ''; // this may contain ':' itself due to IPv6 addresses + for ($i=3; $i<(count($arr)-1); $i++) { + $addr .= $arr[$i]; + } + $port = $arr[count($arr) - 1]; + + return $prot.'://'.$addr.':'.$port; + } + /********************************************************************************* * diff --git a/.github/workflows/zzz-reuse-tests.yml b/.github/workflows/zzz-reuse-tests.yml index da7441ca2..8e6c783ff 100644 --- a/.github/workflows/zzz-reuse-tests.yml +++ b/.github/workflows/zzz-reuse-tests.yml @@ -76,7 +76,7 @@ jobs: cd "${GITHUB_WORKSPACE}/.tests/" # Test full customization - make configure KEY=DEBUG_COMPOSE_ENTRYPOINT VAL="$(( RANDOM % 3 ))" + make configure KEY=DEBUG_ENTRYPOINT VAL="$(( RANDOM % 3 ))" make configure KEY=DOCKER_LOGS VAL="$(( RANDOM % 1 ))" make configure KEY=TLD_SUFFIX VAL=loc2 make configure KEY=TIMEZONE VAL='Europe/Berlin' diff --git a/.tests/Makefile b/.tests/Makefile index c6869e626..16d8e66e5 100644 --- a/.tests/Makefile +++ b/.tests/Makefile @@ -51,7 +51,7 @@ pull: ../.env ### start: ../.env @$(MAKE) --no-print-directory configure KEY=HOST_PATH_HTTPD_DATADIR VAL=.tests/www - @$(MAKE) --no-print-directory configure KEY=DEBUG_COMPOSE_ENTRYPOINT VAL=2 + @$(MAKE) --no-print-directory configure KEY=DEBUG_ENTRYPOINT VAL=3 @$(MAKE) --no-print-directory configure KEY=NEW_UID VAL=$$(id -u) @$(MAKE) --no-print-directory configure KEY=NEW_GID VAL=$$(id -g) @$(PWD)/scripts/compose-start.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c4e56b37..eb99881ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,77 @@ Make sure to have a look at [UPDATING.md](https://github.com/cytopia/devilbox/bl ## Unreleased +## Release v3.0.0-beta-0.1 (2022-12-24) 🎅🎄🎁 + +This is a beta release, using a completely rewritten set of HTTPD server, which allow easy reverse Proxy integration and different PHP versions per project: + +* https://github.com/devilbox/docker-nginx-stable/pull/55 +* https://github.com/devilbox/docker-nginx-mainline/pull/57 +* https://github.com/devilbox/docker-apache-2.2/pull/53 +* https://github.com/devilbox/docker-apache-2.4/pull/54 + +Once it has been tested by the community, and potential errors have been addressed, a new major version will be released. + +**IMPORTANT:** This release required you to copy `env-example` over onto `.env` due to some changes in variables. + +### TL;DR + +1. **Multiple PHP Versions**
+ Here is an example to run one project with a specific PHP version
+ ```bash + # Enable all PHP versions + cp compose/docker-compose.override.yml-php-multi.yml docker-compose.override.yml + # Start default set and php80 + docker-compose up php httpd bind php80 + ``` + file: `/shared/httpd//.devilbox/backend.cfg` + ``` + conf:phpfpm:tcp:php80:9000 + ``` +2. **Automated Reverse Proxy setup**
+ Here is an example to proxy one project to a backend service (e.g. NodeJS or Python application, which runs in the PHP container on port 3000)
+ file: `/shared/httpd//.devilbox/backend.cfg` + ``` + conf:rproxy:http:127.0.0.1:3000 + ``` +#### PHP hostnames and IP addresses + +| PHP Version | Hostname | IP address | +|-------------|----------|----------------| +| 5.4 | php54 | 172.16.238.201 | +| 5.5 | php55 | 172.16.238.202 | +| 5.6 | php56 | 172.16.238.203 | +| 7.0 | php70 | 172.16.238.204 | +| 7.1 | php71 | 172.16.238.205 | +| 7.2 | php72 | 172.16.238.206 | +| 7.3 | php73 | 172.16.238.207 | +| 7.4 | php74 | 172.16.238.208 | +| 8.0 | php80 | 172.16.238.209 | +| 8.1 | php81 | 172.16.238.210 | +| 8.2 | php82 | 172.16.238.211 | + +### Fixed +- Fixed Protocol substitution bug in Reverse Proxy generation for Apache 2.2 and Apache 2.4 [vhost-gen #49](https://github.com/devilbox/vhost-gen/pull/49) [vhost-gen #50](https://github.com/devilbox/vhost-gen/pull/50) +- Fixed missing module `mod_proxy_html` in Apache 2.4 as per requirement from `vhost-gen` for Reverse Proxy setup +- Fixed encoding issue with Apache 2.4 Reverse Proxy by enabling `mod_xml2enc` module (Required by `mod_proxy_html`) +- Allow to run different PHP versions per project. fixes [#146](https://github.com/cytopia/devilbox/issues/146) + +### Added +- New HTTPD server capable of auto reverse proxy creation (and different PHP versions per project) +- Intranet: Added Command & Control center to view watcherd logs and retrigger config in case of vhost changes +- Intranet: vhost page now also shows the configured Backend +- Environment variable `DEVILBOX_HTTPD_MGMT_PASS` +- Environment variable `DEVILBOX_HTTPD_MGMT_USER` +- New Docker Compose Override file `docker-compose.override.yml-php-multi.yml` (allows to run multiple PHP versions). +- Update Bind to latest version + +### Changed +- Disabled `psr` extension by default [php-psr #78](https://github.com/jbboehr/php-psr/issues/78#issuecomment-722290110) +- Disabled `phalcon` extension by default +- Environment variable `DEBUG_COMPOSE_ENTRYPOINT` renamed to `DEBUG_ENTRYPOINT` +- Environment variable `HTTPD_TIMEOUT_TO_PHP_FPM` renamed to `HTTPD_BACKEND_TIMEOUT` + + ## Release v2.4.0 (2022-12-18) This release might be a bit bumpy due to a massive amount of changes in upstream projects. If you encounter issues, please do raise tickets. diff --git a/README.md b/README.md index 7607a45f3..b4a429021 100644 --- a/README.md +++ b/README.md @@ -377,7 +377,7 @@ Every single attachable container comes with many different versions. In order t - 8.2[2] + 8.2 @@ -391,7 +391,7 @@ Every single attachable container comes with many different versions. In order t [1] PHP 5.2 is available to use, but it is not officially supported. The Devilbox intranet does not work with this version as PHP 5.2 does not support namespaces. Furthermore PHP 5.2 does only work with Apache 2.4, Nginx stable and Nginx mainline. It does not work with Apache 2.2. Use at your own risk. -[2] PHP 8.2 is an upcoming unreleased versions of PHP, which is directly built out of their [official git branches](https://github.com/php/php-src/) every night to assure you will leverage their latest features. + > **Documentation:** > [Change container versions](https://devilbox.readthedocs.io/en/latest/getting-started/change-container-versions.html) @@ -558,10 +558,6 @@ The Devilbox has everything setup for you. The only thing you will have to insta :star: Custom PHP config Overwrite any setting for PHP. - - :star: Custom PHP modules - Load custom PHP modules on the fly. - :star: Email catch-all All outgoing emails are catched and will be presented in the included intranet. @@ -611,7 +607,7 @@ The following batteries are available in the Devilbox intranet by default: phpMyAdmin phpPgAdmin phpRedMin - PHPMemcached Admin + PHP Memcached Admin OpCache GUI Mail viewer @@ -647,10 +643,6 @@ The following tools will assist you on creating new projects easily as well as h :wrench: linkcheck linkcheck is a command line tool that searches for URLs in files (optionally limited by extension) and validates their HTTP status code. - - :wrench: homebrew - brew is a MacOS Homenbrew for Linux. - :wrench: markdownlint markdownlint is a markdown linter. @@ -708,11 +700,9 @@ The following tools will assist you on creating new projects easily as well as h Well-known and popular tools will be at your service as well: -Devilbox Devilbox Devilbox Devilbox -Devilbox Devilbox Devilbox Devilbox @@ -856,10 +846,6 @@ PHP modules can be enabled or disabled on demand to reflect the state of your ta > **Documentation:** > [Enable/disable PHP modules](https://devilbox.readthedocs.io/en/latest/intermediate/enable-disable-php-modules.html) -#### Custom PHP Modules - -You can also copy any custom modules into `mod/(php-fpm)-` and add a custom `*.ini` file to load them. - #### Supported PHP Frameworks As far as tested there are no limitations and you can use any Framework or CMS just as you would on your live environment. Below are a few examples of extensively tested Frameworks and CMS: @@ -980,6 +966,7 @@ To increase visibility and bug-free operation: * Star this project * Open up issues for bugs and feature requests * Clone this project and submit fixes or features +* Visit the [Devilbox Discord Chat](https://discord.gg/2wP3V6kBj4) to exchange about setups * Visit the [Devilbox Community Forums](https://devilbox.discourse.group) for announcements and to help others Additionally you can [subscribe to Devilbox on CodeTriage](https://www.codetriage.com/cytopia/devilbox), diff --git a/UPDATING.md b/UPDATING.md index 77e2cd689..c4e3cd0c8 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -3,6 +3,17 @@ This document will hold all information on how to update between major versions. +## Update from `v2.4.0` to `v3.0.0` (`v3.0.0-beta-1`) + +**PR:** https://github.com/cytopia/devilbox/pull/942 + +This PR introduces new `.env` variables, so you are required to copy `env-example` over to `.env`. +Also ensure to stop and remove containers. +```bash +docker-compose stop +docker-compose rm -f +``` + ## Update from `v1.8.1` to `v1.8.2` **PR:** https://github.com/cytopia/devilbox/pull/750 diff --git a/mod/php-fpm-5.2/.keepme b/cfg/mariadb-10.10/.keepme similarity index 100% rename from mod/php-fpm-5.2/.keepme rename to cfg/mariadb-10.10/.keepme diff --git a/cfg/mariadb-10.10/devilbox-custom.cnf-example b/cfg/mariadb-10.10/devilbox-custom.cnf-example new file mode 100644 index 000000000..6d2549fa4 --- /dev/null +++ b/cfg/mariadb-10.10/devilbox-custom.cnf-example @@ -0,0 +1,5 @@ +[mysqld] +;key_buffer_size=16M + +[mysqldump] +;quick diff --git a/mod/php-fpm-5.3/.keepme b/cfg/mariadb-10.8/.keepme similarity index 100% rename from mod/php-fpm-5.3/.keepme rename to cfg/mariadb-10.8/.keepme diff --git a/cfg/mariadb-10.8/devilbox-custom.cnf-example b/cfg/mariadb-10.8/devilbox-custom.cnf-example new file mode 100644 index 000000000..6d2549fa4 --- /dev/null +++ b/cfg/mariadb-10.8/devilbox-custom.cnf-example @@ -0,0 +1,5 @@ +[mysqld] +;key_buffer_size=16M + +[mysqldump] +;quick diff --git a/mod/php-fpm-5.4/.keepme b/cfg/mariadb-10.9/.keepme similarity index 100% rename from mod/php-fpm-5.4/.keepme rename to cfg/mariadb-10.9/.keepme diff --git a/cfg/mariadb-10.9/devilbox-custom.cnf-example b/cfg/mariadb-10.9/devilbox-custom.cnf-example new file mode 100644 index 000000000..6d2549fa4 --- /dev/null +++ b/cfg/mariadb-10.9/devilbox-custom.cnf-example @@ -0,0 +1,5 @@ +[mysqld] +;key_buffer_size=16M + +[mysqldump] +;quick diff --git a/cfg/php-fpm-5.3/README.md b/cfg/php-fpm-5.3/README.md index db30d63f9..6b8c35c15 100644 --- a/cfg/php-fpm-5.3/README.md +++ b/cfg/php-fpm-5.3/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 5.3 config directory ## General diff --git a/cfg/php-fpm-5.4/README.md b/cfg/php-fpm-5.4/README.md index db30d63f9..29fc29cad 100644 --- a/cfg/php-fpm-5.4/README.md +++ b/cfg/php-fpm-5.4/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 5.4 config directory ## General diff --git a/cfg/php-fpm-5.5/README.md b/cfg/php-fpm-5.5/README.md index db30d63f9..b9dc846e6 100644 --- a/cfg/php-fpm-5.5/README.md +++ b/cfg/php-fpm-5.5/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 5.5 config directory ## General diff --git a/cfg/php-fpm-5.6/README.md b/cfg/php-fpm-5.6/README.md index db30d63f9..a6253feba 100644 --- a/cfg/php-fpm-5.6/README.md +++ b/cfg/php-fpm-5.6/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 5.6 config directory ## General diff --git a/cfg/php-fpm-7.0/README.md b/cfg/php-fpm-7.0/README.md index db30d63f9..8d3d6c59d 100644 --- a/cfg/php-fpm-7.0/README.md +++ b/cfg/php-fpm-7.0/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 7.0 config directory ## General diff --git a/cfg/php-fpm-7.1/README.md b/cfg/php-fpm-7.1/README.md index db30d63f9..a957e5827 100644 --- a/cfg/php-fpm-7.1/README.md +++ b/cfg/php-fpm-7.1/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 7.1 config directory ## General diff --git a/cfg/php-fpm-7.2/README.md b/cfg/php-fpm-7.2/README.md index db30d63f9..8b51991c0 100644 --- a/cfg/php-fpm-7.2/README.md +++ b/cfg/php-fpm-7.2/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 7.2 config directory ## General diff --git a/cfg/php-fpm-7.3/README.md b/cfg/php-fpm-7.3/README.md index db30d63f9..9590636fb 100644 --- a/cfg/php-fpm-7.3/README.md +++ b/cfg/php-fpm-7.3/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 7.3 config directory ## General diff --git a/cfg/php-fpm-7.4/README.md b/cfg/php-fpm-7.4/README.md index db30d63f9..4801157bb 100644 --- a/cfg/php-fpm-7.4/README.md +++ b/cfg/php-fpm-7.4/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 7.4 config directory ## General diff --git a/cfg/php-fpm-8.0/README.md b/cfg/php-fpm-8.0/README.md index db30d63f9..93861e41a 100644 --- a/cfg/php-fpm-8.0/README.md +++ b/cfg/php-fpm-8.0/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 8.0 config directory ## General diff --git a/cfg/php-fpm-8.1/README.md b/cfg/php-fpm-8.1/README.md index db30d63f9..838a0fdda 100644 --- a/cfg/php-fpm-8.1/README.md +++ b/cfg/php-fpm-8.1/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 8.1 config directory ## General diff --git a/cfg/php-fpm-8.2/README.md b/cfg/php-fpm-8.2/README.md index db30d63f9..20cafb48f 100644 --- a/cfg/php-fpm-8.2/README.md +++ b/cfg/php-fpm-8.2/README.md @@ -1,4 +1,4 @@ -# PHP-FPM config directory +# PHP-FPM 8.2 config directory ## General diff --git a/cfg/php-ini-5.2/README.md b/cfg/php-ini-5.2/README.md index b967fcaa0..a3882782a 100644 --- a/cfg/php-ini-5.2/README.md +++ b/cfg/php-ini-5.2/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 5.2 ini directory ## General diff --git a/cfg/php-ini-5.3/README.md b/cfg/php-ini-5.3/README.md index b967fcaa0..249241049 100644 --- a/cfg/php-ini-5.3/README.md +++ b/cfg/php-ini-5.3/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 5.3 ini directory ## General diff --git a/cfg/php-ini-5.4/README.md b/cfg/php-ini-5.4/README.md index b967fcaa0..6e899f518 100644 --- a/cfg/php-ini-5.4/README.md +++ b/cfg/php-ini-5.4/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 5.4 ini directory ## General diff --git a/cfg/php-ini-5.5/README.md b/cfg/php-ini-5.5/README.md index b967fcaa0..3d35d1fc4 100644 --- a/cfg/php-ini-5.5/README.md +++ b/cfg/php-ini-5.5/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 5.5 ini directory ## General diff --git a/cfg/php-ini-5.6/README.md b/cfg/php-ini-5.6/README.md index b045e97aa..5639d787f 100644 --- a/cfg/php-ini-5.6/README.md +++ b/cfg/php-ini-5.6/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 5.6 ini directory ## General diff --git a/cfg/php-ini-7.0/README.md b/cfg/php-ini-7.0/README.md index b045e97aa..8912cbfba 100644 --- a/cfg/php-ini-7.0/README.md +++ b/cfg/php-ini-7.0/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 7.0 ini directory ## General diff --git a/cfg/php-ini-7.1/README.md b/cfg/php-ini-7.1/README.md index b045e97aa..488ea05a5 100644 --- a/cfg/php-ini-7.1/README.md +++ b/cfg/php-ini-7.1/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 7.1 ini directory ## General diff --git a/cfg/php-ini-7.2/README.md b/cfg/php-ini-7.2/README.md index b045e97aa..52fd25052 100644 --- a/cfg/php-ini-7.2/README.md +++ b/cfg/php-ini-7.2/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 7.2 ini directory ## General diff --git a/cfg/php-ini-7.3/README.md b/cfg/php-ini-7.3/README.md index b045e97aa..518a35863 100644 --- a/cfg/php-ini-7.3/README.md +++ b/cfg/php-ini-7.3/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 7.3 ini directory ## General diff --git a/cfg/php-ini-7.4/README.md b/cfg/php-ini-7.4/README.md index b967fcaa0..bb2235c7e 100644 --- a/cfg/php-ini-7.4/README.md +++ b/cfg/php-ini-7.4/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 7.4 ini directory ## General diff --git a/cfg/php-ini-8.0/README.md b/cfg/php-ini-8.0/README.md index b967fcaa0..85366e216 100644 --- a/cfg/php-ini-8.0/README.md +++ b/cfg/php-ini-8.0/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 8.0 ini directory ## General diff --git a/cfg/php-ini-8.1/README.md b/cfg/php-ini-8.1/README.md index b967fcaa0..19f76673c 100644 --- a/cfg/php-ini-8.1/README.md +++ b/cfg/php-ini-8.1/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 8.1 ini directory ## General diff --git a/cfg/php-ini-8.2/README.md b/cfg/php-ini-8.2/README.md index b967fcaa0..94ddf62ed 100644 --- a/cfg/php-ini-8.2/README.md +++ b/cfg/php-ini-8.2/README.md @@ -1,4 +1,4 @@ -# PHP ini directory +# PHP 8.2 ini directory ## General diff --git a/cfg/php-startup-5.2/README.md b/cfg/php-startup-5.2/README.md index e212252ea..17b5bd75c 100644 --- a/cfg/php-startup-5.2/README.md +++ b/cfg/php-startup-5.2/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 5.2 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-5.3/README.md b/cfg/php-startup-5.3/README.md index e212252ea..6e6f07df4 100644 --- a/cfg/php-startup-5.3/README.md +++ b/cfg/php-startup-5.3/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 5.3 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-5.4/README.md b/cfg/php-startup-5.4/README.md index e212252ea..ad492ab60 100644 --- a/cfg/php-startup-5.4/README.md +++ b/cfg/php-startup-5.4/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 5.4 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-5.5/README.md b/cfg/php-startup-5.5/README.md index e212252ea..45a17bb88 100644 --- a/cfg/php-startup-5.5/README.md +++ b/cfg/php-startup-5.5/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 5.5 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-5.6/README.md b/cfg/php-startup-5.6/README.md index e212252ea..a12fed0ae 100644 --- a/cfg/php-startup-5.6/README.md +++ b/cfg/php-startup-5.6/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 5.6 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-7.0/README.md b/cfg/php-startup-7.0/README.md index e212252ea..0fb98c2e6 100644 --- a/cfg/php-startup-7.0/README.md +++ b/cfg/php-startup-7.0/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 7.0 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-7.1/README.md b/cfg/php-startup-7.1/README.md index e212252ea..c2fc1f4c0 100644 --- a/cfg/php-startup-7.1/README.md +++ b/cfg/php-startup-7.1/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 7.1 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-7.2/README.md b/cfg/php-startup-7.2/README.md index e212252ea..f4cad33be 100644 --- a/cfg/php-startup-7.2/README.md +++ b/cfg/php-startup-7.2/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 7.2 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-7.3/README.md b/cfg/php-startup-7.3/README.md index e212252ea..2018e87db 100644 --- a/cfg/php-startup-7.3/README.md +++ b/cfg/php-startup-7.3/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 7.3 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-7.4/README.md b/cfg/php-startup-7.4/README.md index e212252ea..8796aef9b 100644 --- a/cfg/php-startup-7.4/README.md +++ b/cfg/php-startup-7.4/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 7.4 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-8.0/README.md b/cfg/php-startup-8.0/README.md index e212252ea..8589ffded 100644 --- a/cfg/php-startup-8.0/README.md +++ b/cfg/php-startup-8.0/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 8.0 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-8.1/README.md b/cfg/php-startup-8.1/README.md index e212252ea..789124a5e 100644 --- a/cfg/php-startup-8.1/README.md +++ b/cfg/php-startup-8.1/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 8.1 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/cfg/php-startup-8.2/README.md b/cfg/php-startup-8.2/README.md index e212252ea..8ceb5408e 100644 --- a/cfg/php-startup-8.2/README.md +++ b/cfg/php-startup-8.2/README.md @@ -1,4 +1,4 @@ -# Custom startup scripts (per PHP version) +# Custom startup scripts (for PHP 8.2 only) Any script inside this directory ending by `.sh` will be executed during the PHP container startup. This is useful to apply your custom settings such as installing software that usually requires diff --git a/check-config.sh b/check-config.sh index d94939b4d..e39d6bd1a 100755 --- a/check-config.sh +++ b/check-config.sh @@ -219,13 +219,13 @@ print_head_1 "Checking .env file values" WRONG_ENV_FILES_VALUES=0 -DEBUG_COMPOSE_ENTRYPOINT="$( get_env_value "DEBUG_COMPOSE_ENTRYPOINT" )" -if [ "${DEBUG_COMPOSE_ENTRYPOINT}" != "0" ] && [ "${DEBUG_COMPOSE_ENTRYPOINT}" != "1" ] && [ "${DEBUG_COMPOSE_ENTRYPOINT}" != "2" ]; then - log_err "Variable 'DEBUG_COMPOSE_ENTRYPOINT' should be 0, 1 or 2. Has: ${DEBUG_COMPOSE_ENTRYPOINT}" +DEBUG_ENTRYPOINT="$( get_env_value "DEBUG_ENTRYPOINT" )" +if [ "${DEBUG_ENTRYPOINT}" != "0" ] && [ "${DEBUG_ENTRYPOINT}" != "1" ] && [ "${DEBUG_ENTRYPOINT}" != "2" ] && [ "${DEBUG_ENTRYPOINT}" != "3" ] && [ "${DEBUG_ENTRYPOINT}" != "3" ]; then + log_err "Variable 'DEBUG_ENTRYPOINT' should be 0, 1 or 2. Has: ${DEBUG_ENTRYPOINT}" RET_CODE=$(( RET_CODE + 1)) WRONG_ENV_FILES_VALUES=1 else - log_debug "Variable 'DEBUG_COMPOSE_ENTRYPOINT' has correct value: ${DEBUG_COMPOSE_ENTRYPOINT}" + log_debug "Variable 'DEBUG_ENTRYPOINT' has correct value: ${DEBUG_ENTRYPOINT}" fi DOCKER_LOGS="$( get_env_value "DOCKER_LOGS" )" @@ -430,7 +430,7 @@ fi #-------------------------------------------------------------------------------------------------- -# Ensure cfg/, mod/ and log/ directories exist +# Ensure cfg/ and log/ directories exist #-------------------------------------------------------------------------------------------------- print_head_1 "Checking required Devilbox core directories exist" @@ -464,21 +464,6 @@ if [ "${DIR_MISSING}" = "0" ]; then log_ok "All PHP log/ sub directories are present" fi -# /mod/php-fpm-VERSION -DIR_MISSING=0 -while read -r php_version; do - if [ ! -d "mod/php-fpm-${php_version}" ]; then - log_err "Directory 'mod/php-fpm-${php_version}' is missing" - RET_CODE=$(( RET_CODE + 1)) - DIR_MISSING=1 - else - log_debug "Directory 'mod/php-fpm-${php_version}' is present" - fi -done < <(grep -E '^#?PHP_SERVER=' env-example | awk -F'=' '{print $2}') -if [ "${DIR_MISSING}" = "0" ]; then - log_ok "All PHP mod/ sub directories are present" -fi - # /cfg/apache|nginx-VERSION DIR_MISSING=0 while read -r httpd_version; do @@ -522,7 +507,6 @@ DEVILBOX_DIRS=( "cfg" "compose" "log" - "mod" "supervisor" ) @@ -591,7 +575,6 @@ DEVILBOX_DIRS=( "ca" "cfg" "compose" - "mod" "supervisor" ) diff --git a/compose/docker-compose.override.yml-php-multi.yml b/compose/docker-compose.override.yml-php-multi.yml new file mode 100644 index 000000000..96cde440e --- /dev/null +++ b/compose/docker-compose.override.yml-php-multi.yml @@ -0,0 +1,231 @@ +# vim: set ft=yaml: +--- +version: '2.3' + +# ------------------------------------------------------------ +# Yaml Default +# ------------------------------------------------------------ + +### +### Default PHP-FPM config +### +x-app: &default-php + env_file: + - ./.env + environment: + # Debug/Logging + - DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT:-2} + - DOCKER_LOGS=1 + # Enable/Disable PHP Modules + - ENABLE_MODULES=${PHP_MODULES_ENABLE} + - DISABLE_MODULES=${PHP_MODULES_DISABLE} + # Mail-catching + - ENABLE_MAIL=${PHP_MAIL_CATCH_ALL:-2} + dns: + - 172.16.238.100 + depends_on: + - bind + + +# ------------------------------------------------------------ +# PHP Services +# ------------------------------------------------------------ +services: + + php54: + <<: *default-php + image: devilbox/php-fpm:5.4-prod-0.147 + hostname: php54 + networks: + app_net: + ipv4_address: 172.16.238.201 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-5.4:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-5.4:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-5.4:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php55: + <<: *default-php + image: devilbox/php-fpm:5.5-prod-0.147 + hostname: php55 + networks: + app_net: + ipv4_address: 172.16.238.202 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-5.5:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-5.5:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-5.5:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php56: + <<: *default-php + image: devilbox/php-fpm:5.6-prod-0.147 + hostname: php56 + networks: + app_net: + ipv4_address: 172.16.238.203 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-5.6:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-5.6:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-5.6:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php70: + <<: *default-php + image: devilbox/php-fpm:7.0-prod-0.147 + hostname: php70 + networks: + app_net: + ipv4_address: 172.16.238.204 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-7.0:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-7.0:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-7.0:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php71: + <<: *default-php + image: devilbox/php-fpm:7.1-prod-0.147 + hostname: php71 + networks: + app_net: + ipv4_address: 172.16.238.205 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-7.1:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-7.1:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-7.1:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php72: + <<: *default-php + image: devilbox/php-fpm:7.2-prod-0.147 + hostname: php72 + networks: + app_net: + ipv4_address: 172.16.238.206 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-7.2:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-7.2:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-7.2:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php73: + <<: *default-php + image: devilbox/php-fpm:7.3-prod-0.147 + hostname: php73 + networks: + app_net: + ipv4_address: 172.16.238.207 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-7.3:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-7.3:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-7.3:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php74: + <<: *default-php + image: devilbox/php-fpm:7.4-prod-0.147 + hostname: php74 + networks: + app_net: + ipv4_address: 172.16.238.208 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-7.4:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-7.4:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-7.4:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php80: + <<: *default-php + image: devilbox/php-fpm:8.0-prod-0.147 + hostname: php80 + networks: + app_net: + ipv4_address: 172.16.238.209 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-8.0:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-8.0:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-8.0:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php81: + <<: *default-php + image: devilbox/php-fpm:8.1-prod-0.147 + hostname: php81 + networks: + app_net: + ipv4_address: 172.16.238.210 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-8.1:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-8.1:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-8.1:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} + + php82: + <<: *default-php + image: devilbox/php-fpm:8.2-prod-0.147 + hostname: php82 + networks: + app_net: + ipv4_address: 172.16.238.211 + volumes: + # Specific volumes + - ${DEVILBOX_PATH}/cfg/php-ini-8.2:/etc/php-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-fpm-8.2:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/cfg/php-startup-8.2:/startup.1.d:rw${MOUNT_OPTIONS} + # Generic volumes + - ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/supervisor:/etc/supervisor/custom.d:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} + - devilbox-mail:/var/mail:rw${MOUNT_OPTIONS} diff --git a/docker-compose.yml b/docker-compose.yml index 9deedd011..29b0fa8fe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ services: # Bind (DNS Server) # ------------------------------------------------------------ bind: - image: cytopia/bind:alpine-0.34 + image: cytopia/bind:alpine-0.35 hostname: bind restart: always ports: @@ -46,7 +46,7 @@ services: ## ## Debug? ## - - DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT} + - DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT:-2} ## ## Memory consumption @@ -112,11 +112,17 @@ services: - ./.env environment: + ## + ## Supervisord Management (to connect to HTTPD supvervisord) + ## + - SVCTL_LISTEN_PORT=9001 + - SVCTL_USER=${DEVILBOX_HTTPD_MGMT_USER:-supervisor} + - SVCTL_PASS=${DEVILBOX_HTTPD_MGMT_PASS:-mypassword} + ## ## Debug/Logging ## - - DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT} - - DEBUG_COMPOSE_ENTRYPOINT + - DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT:-2} - DOCKER_LOGS ## @@ -197,10 +203,6 @@ services: # to overwrite the default PHP-FPM configuration - ${DEVILBOX_PATH}/cfg/php-fpm-${PHP_SERVER}:/etc/php-fpm-custom.d:ro${MOUNT_OPTIONS} - # Mount devilbox user-defined *.so files in order - # to load custom PHP modules - - ${DEVILBOX_PATH}/mod/php-fpm-${PHP_SERVER}:/usr/lib64/php/custom-modules:ro${MOUNT_OPTIONS} - # Mount devilbox user-defined PHP-FPM startup *.sh scripts - ${DEVILBOX_PATH}/cfg/php-startup-${PHP_SERVER}:/startup.1.d:rw${MOUNT_OPTIONS} - ${DEVILBOX_PATH}/autostart:/startup.2.d:rw${MOUNT_OPTIONS} @@ -225,16 +227,26 @@ services: # Web Server # ------------------------------------------------------------ httpd: - image: devilbox/${HTTPD_SERVER}:${HTTPD_FLAVOUR:-alpine}-0.48 + image: devilbox/${HTTPD_SERVER}:${HTTPD_FLAVOUR:-alpine}-1.0-beta1 hostname: httpd environment: + ## + ## Supervisord Management + ## + - SVCTL_ENABLE=1 + - SVCTL_LISTEN_ADDR=0.0.0.0 + - SVCTL_LISTEN_PORT=9001 + - SVCTL_REMOTE_LOGS_ENABLE=1 + - SVCTL_USER=${DEVILBOX_HTTPD_MGMT_USER:-supervisor} + - SVCTL_PASS=${DEVILBOX_HTTPD_MGMT_PASS:-mypassword} + ## ## Debug/Logging ## - - DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT} - - DEBUG_RUNTIME=${DEBUG_COMPOSE_ENTRYPOINT} + - DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT:-2} + - DEBUG_RUNTIME=1 - DOCKER_LOGS ## @@ -268,25 +280,23 @@ services: - MAIN_VHOST_SSL_TYPE=${HTTPD_VHOST_SSL_TYPE:-both} - MAIN_VHOST_SSL_GEN=1 - MAIN_VHOST_SSL_CN=${DEVILBOX_UI_SSL_CN:-localhost} + - MAIN_VHOST_BACKEND=conf:phpfpm:tcp:172.16.238.10:9000 + - MAIN_VHOST_BACKEND_TIMEOUT=${HTTPD_BACKEND_TIMEOUT:-180} + - MAIN_VHOST_ALIASES_ALLOW=/devilbox-api/:/var/www/default/api, /vhost.d/:/etc/httpd ## ## Enable Mass Vhosts ## - MASS_VHOST_ENABLE=1 - - MASS_VHOST_TLD=.${TLD_SUFFIX} - - MASS_VHOST_DOCROOT=${HTTPD_DOCROOT_DIR} - - MASS_VHOST_TPL=${HTTPD_TEMPLATE_DIR} + - MASS_VHOST_TLD_SUFFIX=.${TLD_SUFFIX} + - MASS_VHOST_DOCROOT_DIR=${HTTPD_DOCROOT_DIR} + - MASS_VHOST_TEMPLATE_DIR=${HTTPD_TEMPLATE_DIR} - MASS_VHOST_SSL_TYPE=${HTTPD_VHOST_SSL_TYPE:-both} - MASS_VHOST_SSL_GEN=1 - - ## - ## PHP-FPM Remote Server - ## - - COMPAT=${PHP_SERVER} - - PHP_FPM_ENABLE=1 - - PHP_FPM_SERVER_ADDR=172.16.238.10 - - PHP_FPM_SERVER_PORT=9000 - - PHP_FPM_TIMEOUT=${HTTPD_TIMEOUT_TO_PHP_FPM:-180} + - MASS_VHOST_BACKEND=conf:phpfpm:tcp:172.16.238.10:9000 + - MASS_VHOST_BACKEND_REWRITE=file:backend.cfg + - MASS_VHOST_BACKEND_TIMEOUT=${HTTPD_BACKEND_TIMEOUT:-180} + - MASS_VHOST_ALIASES_ALLOW=/devilbox-api/:/var/www/default/api:http(s)?://(.*)$$ ports: # ---- Format: ---- @@ -315,7 +325,7 @@ services: - ${DEVILBOX_PATH}/cfg/vhost-gen:/etc/vhost-gen.d:rw${MOUNT_OPTIONS} # Mount logs - - ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/${HTTPD_SERVER}:rw${MOUNT_OPTIONS} + - ${DEVILBOX_PATH}/log/${HTTPD_SERVER}:/var/log/httpd:rw${MOUNT_OPTIONS} # Certificate Authority public key - ${DEVILBOX_PATH}/ca:/ca:rw${MOUNT_OPTIONS} diff --git a/docs/_includes/links/documentation.rst b/docs/_includes/links/documentation.rst index c2c30b8e6..6c6b2a88f 100644 --- a/docs/_includes/links/documentation.rst +++ b/docs/_includes/links/documentation.rst @@ -12,8 +12,8 @@ .. |ext_lnk_doc_bind_soa| raw:: html - - BIND SOA + + BIND Reference .. |ext_lnk_doc_wiki_database_timezones| raw:: html diff --git a/docs/_includes/links/examples.rst b/docs/_includes/links/examples.rst index df4ecffbd..afa638a19 100644 --- a/docs/_includes/links/examples.rst +++ b/docs/_includes/links/examples.rst @@ -72,7 +72,7 @@ .. |ext_lnk_example_magento2_documentation| raw:: html - + Official Magento 2 Documentation diff --git a/docs/_includes/links/xdebug.rst b/docs/_includes/links/xdebug.rst index c072665a2..e117ceb97 100644 --- a/docs/_includes/links/xdebug.rst +++ b/docs/_includes/links/xdebug.rst @@ -36,7 +36,7 @@ .. |ext_lnk_xdebug_ide_atom_php_debug| raw:: html - + php-debug diff --git a/docs/_includes/snippets/__ANNOUNCEMENTS__.rst b/docs/_includes/snippets/__ANNOUNCEMENTS__.rst index d5282294b..348b7e8aa 100644 --- a/docs/_includes/snippets/__ANNOUNCEMENTS__.rst +++ b/docs/_includes/snippets/__ANNOUNCEMENTS__.rst @@ -1,11 +1,11 @@ -.. |ext_lnk_php_community_github_announce| raw:: html +.. |ext_lnk_devilbox_pr_announce| raw:: html - - PHP-FPM Community + + Release v3.0.0-beta-0.1 .. attention:: - You can now create your own **custom flavour** of PHP-FPM Community images and easily add them to the Devilbox: |ext_lnk_php_community_github_announce| + You can now run different PHP versions per project: |ext_lnk_devilbox_pr_announce| diff --git a/docs/advanced/overwrite-existing-docker-image.rst b/docs/advanced/overwrite-existing-docker-image.rst index 2d6af888f..eabace3a0 100644 --- a/docs/advanced/overwrite-existing-docker-image.rst +++ b/docs/advanced/overwrite-existing-docker-image.rst @@ -67,7 +67,7 @@ First you simply copy the while definition of the bind service from ``docker-com ## ## Debug? ## - - DEBUG_ENTRYPOINT=${DEBUG_COMPOSE_ENTRYPOINT} + - DEBUG_ENTRYPOINT=${DEBUG_ENTRYPOINT} - DOCKER_LOGS=1 ## diff --git a/docs/configuration-files/env-file.rst b/docs/configuration-files/env-file.rst index 30b2f70cb..fcd339653 100644 --- a/docs/configuration-files/env-file.rst +++ b/docs/configuration-files/env-file.rst @@ -32,18 +32,18 @@ to ``.env`` to initially create it with sane defaults. Core settings ============= -DEBUG_COMPOSE_ENTRYPOINT ------------------------- +DEBUG_ENTRYPOINT +---------------- This variable controls the docker-compose log verbosity during service startup. When set to ``1`` verbose output as well as executed commands are shown. When set to ``0`` only warnings and errors are shown. -+------------------------------+----------------+---------------+ -| Name | Allowed values | Default value | -+==============================+================+===============+ -| ``DEBUG_COMPOSE_ENTRYPOINT`` | ``0`` or ``1`` | ``1`` | -+------------------------------+----------------+---------------+ ++------------------------------+-----------------------------------+---------------+ +| Name | Allowed values | Default value | ++==============================+===================================+===============+ +| ``DEBUG_ENTRYPOINT`` | ``0``, ``1``, ``2``, ``3``, ``4`` | ``2`` | ++------------------------------+-----------------------------------+---------------+ .. _env_docker_logs: @@ -1505,8 +1505,8 @@ changing the server name or adding locations to other assets. .. _env_httpd_timeout_to_php_fpm: -HTTPD_TIMEOUT_TO_PHP_FPM -^^^^^^^^^^^^^^^^^^^^^^^^ +HTTPD_BACKEND_TIMEOUT +^^^^^^^^^^^^^^^^^^^^^ This variable specifies after how many seconds the webserver should quit an unanswered connection to PHP-FPM. @@ -1515,17 +1515,17 @@ Ensure that this value is higher than PHP's ``max_execution_time``, otherwise th could still run and the webserver will simply drop the connection before getting an answer by PHP. -If ``HTTPD_TIMEOUT_TO_PHP_FPM`` is smaller then ``max_execution_time`` and a script runs longer +If ``HTTPD_BACKEND_TIMEOUT`` is smaller then ``max_execution_time`` and a script runs longer than ``max_execution_time``, you will get a: ``504 Gateway timeout`` in the browser. -If ``HTTPD_TIMEOUT_TO_PHP_FPM`` is greater then ``max_execution_time`` and a script runs longer +If ``HTTPD_BACKEND_TIMEOUT`` is greater then ``max_execution_time`` and a script runs longer than ``max_execution_time``, you will get a proper PHP error message in the browser. +------------------------------+-------------------+------------------+ | Name | Allowed values | Default value | +==============================+===================+==================+ -| ``HTTPD_TIMEOUT_TO_PHP_FPM`` | positive integer | ``180`` | +| ``HTTPD_BACKEND_TIMEOUT`` | positive integer | ``180`` | +------------------------------+-------------------+------------------+ HTTPD_NGINX_WORKER_PROCESSES diff --git a/docs/intermediate/enable-disable-php-modules.rst b/docs/intermediate/enable-disable-php-modules.rst index aa875b921..044563a97 100644 --- a/docs/intermediate/enable-disable-php-modules.rst +++ b/docs/intermediate/enable-disable-php-modules.rst @@ -11,7 +11,7 @@ Enable/disable PHP modules .. contents:: :local: .. seealso:: - https://github.com/devilbox/docker-php-fpm#user-content-php-modules + https://github.com/devilbox/docker-php-fpm/blob/master/doc/php-modules.md Follow the link to see all available PHP modules for each different PHP-FPM server version. diff --git a/env-example b/env-example index 5d4f18f60..d200159b4 100644 --- a/env-example +++ b/env-example @@ -28,10 +28,12 @@ ### Show all executed commands in each ### docker image during docker-compose up? ### -### 0: Quiet -### 1: Verbose -### 2: More verbose -DEBUG_COMPOSE_ENTRYPOINT=2 +### 0: Errors +### 1: Errors, Warnings +### 2: Errors, Warnings, Infos (Recommended) +### 3: Errors, Warnings, Infos, Debug +### 4: Errors, Warnings, Infos, Debug, Trace +DEBUG_ENTRYPOINT=2 ### @@ -236,6 +238,12 @@ DEVILBOX_VENDOR_PHPMYADMIN_AUTOLOGIN=1 ### DEVILBOX_VENDOR_PHPPGADMIN_AUTOLOGIN=1 +### +### HTTPD Supvervisord management +### +DEVILBOX_HTTPD_MGMT_USER=supervisord +DEVILBOX_HTTPD_MGMT_PASS=mypassword + ################################################################################ @@ -515,7 +523,7 @@ PHP_MODULES_ENABLE= ### ### PHP_MODULES_DISABLE=xdebug,imagick,swoole ### -PHP_MODULES_DISABLE=oci8,PDO_OCI,pdo_sqlsrv,sqlsrv,rdkafka,swoole +PHP_MODULES_DISABLE=oci8,PDO_OCI,pdo_sqlsrv,sqlsrv,rdkafka,swoole,psr,phalcon ### @@ -609,13 +617,16 @@ HTTPD_TEMPLATE_DIR=.devilbox ### -### Webserver timeout (in seconds) to upstream PHP-FPM server +### Remote (Upstream) Backend Timeout +### +### This setting specifies the Timeout for a remote Backend server, +### such as PHP-FPM or a Reverse Proxy. ### -### This value should be greater than PHP's max_execution_time, -### otherwise the php script could still run and the webserver will -### simply drop the connection before getting an answer by PHP. +### As for PHP, keep in mind that this value should be greater than +### PHP's max_execution_time,otherwise the php script could still +### run and the webserver will simply drop the connection before getting an answer by PHP. ### -HTTPD_TIMEOUT_TO_PHP_FPM=180 +HTTPD_BACKEND_TIMEOUT=180 ### diff --git a/mod/README.md b/mod/README.md deleted file mode 100644 index 770666b17..000000000 --- a/mod/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Devilbox user-defined PHP modules - -Use this folders to add your custom PHP modules. diff --git a/mod/php-fpm-5.5/.keepme b/mod/php-fpm-5.5/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-5.6/.keepme b/mod/php-fpm-5.6/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-7.0/.keepme b/mod/php-fpm-7.0/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-7.1/.keepme b/mod/php-fpm-7.1/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-7.2/.keepme b/mod/php-fpm-7.2/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-7.3/.keepme b/mod/php-fpm-7.3/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-7.4/.keepme b/mod/php-fpm-7.4/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-8.0/.keepme b/mod/php-fpm-8.0/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-8.1/.keepme b/mod/php-fpm-8.1/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/php-fpm-8.2/.keepme b/mod/php-fpm-8.2/.keepme deleted file mode 100644 index e69de29bb..000000000