Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎅🎄🎁 #942

Merged
merged 27 commits into from
Dec 25, 2022
Merged

🎅🎄🎁 #942

merged 27 commits into from
Dec 25, 2022

Conversation

cytopia
Copy link
Owner

@cytopia cytopia commented Dec 23, 2022

Release v3.0.0-beta-0.1 (2022-12-24) 🎅🎄🎁

  • Run different PHP versions per project

  • Reverse Proxy automation

Please report issues in this PR or reach out in Discord.

Screenshot 2022-12-25 18-05-25  selection


This is a beta release, using a completely rewritten set of HTTPD server, based on these changes:

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
    # 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/<project>/.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/<project>/.devilbox/backend.cfg
    conf:rproxy:http:127.0.0.1:3000
    

PHP hostnames and IP addresses

Note: Use IP addresses instead of hostnames for Nginx

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

### Important

Currently the Intranet Command and Control Center is not yet self sufficient as it requires a supervisord configuration file.

In the root of the Devilbox repository, add supervisorctl.conf into supervisor/ directory. Important: It must have this name.
ini~~ ~~[supervisorctl]~~ ~~serverurl=http://httpd:9001~~ ~~username=supervisord~~ ~~password=mypassword~~ ~~

Fixed

  • Fixed Protocol substitution bug in Reverse Proxy generation for Apache 2.2 and Apache 2.4 vhost-gen #49 vhost-gen #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

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
  • 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
  • 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

@llaville
Copy link
Contributor

Merry Christmas @cytopia, and thanks for this gift !

One little question, about hostnames : is it a typo when you write the same hostname for PHP versions, or expected results ?

5.4 php54 172.16.238.201
5.5 php54 172.16.238.202
5.6 php54 172.16.238.203

@cytopia
Copy link
Owner Author

cytopia commented Dec 24, 2022

Merry Christmas @cytopia, and thanks for this gift !

One little question, about hostnames : is it a typo when you write the same hostname for PHP versions, or expected results ?

5.4 php54 172.16.238.201
5.5 php54 172.16.238.202
5.6 php54 172.16.238.203

Thanks and fixed :-)

@cytopia
Copy link
Owner Author

cytopia commented Dec 25, 2022

Now also showing the configured Backend on the vhosts.php page in the intranet.

@cytopia cytopia merged commit 6819619 into master Dec 25, 2022
@cytopia cytopia deleted the release/v3.0.0-beta-0.1 branch December 25, 2022 19:42
@minhchu
Copy link
Contributor

minhchu commented Dec 28, 2022

So much awesome, thank you

@cytopia cytopia self-assigned this Dec 28, 2022
@razorcell
Copy link

The box is cool Thanks for sharing this fantastic work !

@jhaveDK
Copy link

jhaveDK commented Apr 4, 2023

@cytopia Nice work, but its possible to add a function so its only starts the PHP versions there are in use with "docker-compose up -d" ?

@zulfiqarpk92
Copy link

I am trying to setup multiple php versions. But it is giving "File not found" error in browser when I setup a project with specific php version e.g php81. I have added backend.cfg for the project like below.

conf:phpfpm:tcp:172.16.238.210:9000

Any idea what I am doing wrong?

@vikas5914
Copy link
Contributor

@zulfiqarpk92 Can you please provide where you put the file as well the file name?

Also, provide a screenshot of Vhost in Devilbox localhost.

Make sure you restart the Devilbox again. sometimes it does not take the first restart.

@zulfiqarpk92
Copy link

@vikas5914 I have placed the file in <project>/.devilbox/backend.cfg. Check below screenshot. It is from the main php container.

image

Screenshot for Vhosts:

image

I have restarted several times but no luck.

Thanks

1 similar comment
@zulfiqarpk92
Copy link

@vikas5914 I have placed the file in <project>/.devilbox/backend.cfg. Check below screenshot. It is from the main php container.

image

Screenshot for Vhosts:

image

I have restarted several times but no luck.

Thanks

@vikas5914
Copy link
Contributor

@zulfiqarpk92 Can you try conf:phpfpm:tcp:php80:9000

@zulfiqarpk92
Copy link

@vikas5914 I found the issue. It was not the IP. Actually, I have my projects placed in a separate directory and created vhosts using soft links in the dvlbox data/www directory. In main compose file I had mounted the projects directory but not in the other php containers that's why it was giving file not found error. It started working after adding volumes to the php containers.

Thanks

@frankbret
Copy link

Be really careful with the "/shared/httpd//.devilbox/backend.cfg" file to NOT LEAVE BLANK LINE at the end of the file. Else default php run and Devilbox Comand & Control "watcherd stderr" said :
[WARN] [abc.proweb.local] Backend rewrite config is invalid: Invalid backend conf: in: 'conf:phpfpm:tcp:php74:9000
'. It must be a valid port
[WARN] [abc.proweb.local] Backend rewrite: skipping

@arcanisgk
Copy link

arcanisgk commented Jul 29, 2024

Hello, I am interested in something in particular.

If I have two projects in their respective directories of my windows (Host OS)...
I want them both to use php 7.4.

Is it possible to mount these projects as if they were volumes and that both use the same php7.4 to save resources?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Community Discussion) Run multiply PHP versions at the same time
9 participants