Skip navigation

Conditional Logic for Injecting Apache Conf Rules

Help

Conditional Logic for Injecting Apache Conf Rules

Referenced Page: 
Injecting into site vhosts

I am trying to inject additional apache conf files for specific hosts, and I am using this code in a file called wwwlegacy.drush.inc in /var/aegir/.drush:

<?php
 
function wwwlegacy_provision_apache_vhost_config($uri, $data) {
    if (
$uri == "cms.test.domain.com") {
      return array(
"Include conf.d/www-legacy-redirect.conf","Include conf.d/www-legacy-proxy.conf");
    }
  }
?>

but this does not inject the two lines into the vhost entry of cms.test.domain.com after I verify the site. When I remove the if statement, it works, but I don't want it going to all the sites.

Looks like I am missing something very basic ... ?

Thanks!

#1

Figured it out. I was modifying uri in a previous drush.inc file and the uri was not coming through as expected. Two lessons learned.

Need help?

Discussion

The discussion area lets your team communicate by posting updates and discussing issues. It is a great place for sharing progress, discussing challenges, and exploring ideas.