Problem/Motivation

Drupal 9.4.9 has a strong suggestion for php8.1.6.
it would be nice to be able to run aegir itself under php7.4 since it is still on Drupal 7 while having other sites run on the best php version for them which might be php8.1.6.

I see here that Nginx can be used to do it in general but since Aegir takes over the virtual hosting, what would have to be done to the aegir.conf file to support multiple php versions.

https://www.atlantic.net/vps-hosting/host-multiple-websites-with-differe...

This solutions was given in Slack by JonPugh but only works for apache2,
https://git.drupalcode.org/project/hosting/-/commit/9aaf9037e08fea425091...

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

SocialNicheGuru created an issue. See original summary.

SocialNicheGuru’s picture

ac’s picture

You can do this manually by creating a file in /var/aegir/.drush/

This example is for apache but you can use drush_hook_provision_nginx_vhost_config for nginx.

<?php
function foo_provision_apache_vhost_config($uri, $data) {

  $sites = [
    'www.site1.com',
    'www.site2.com',
  ];

  if (in_array($uri, $sites)) {
    return array("
    Include /etc/apache2/conf-available/php7.2-fpm.conf
    ");
  } else {
    return array("
    Include /etc/apache2/conf-available/php7.4-fpm.conf
    ");
  }
}
SocialNicheGuru’s picture

I get it now. Thanks for the pointers.

Unfortunately nothing I do will work.
I want to conditionally change from php7.4-fpm to php8.1-fpm

This file is the last line in vhost:
include /var/aegir/config/includes/nginx_vhost_common.conf;

I wanted to overwrite it's values but cannot do that since it is the last item

SocialNicheGuru’s picture

I upgraded hostmaster to Drupal 7.100 which takes php8.1 and possibly 8.2

I upgraded the file, /var/aegir/config/includes/nginx_vhost_common.conf, to reflect this