Aegir Module to Add Apache Aliases

Events happening in the community are now at Drupal community events on www.drupal.org.
d1b1's picture

Greatings All,

We are working our way through the aegir suite of modules, hooks and code. We recently found that if we added our own aliases for files etc to the vhost files, they got wacked during the next verify (Makes sense). The Aegir Verify task rebuilds the site apache vhost file each time. We then found and added code to the template file used to build the vhost files. This provides a great solution for aliases we wanted included for all new sites.

template: provision/web_server/provision_apache_vhost.tpl.php

What we want now is the ability to add custom vhost commands in the aegir site edit page. And have these included in the vhost rebuild process using the $options['extra_config']. We coded basic a proof of concept that uses a drush file, module and the aegir provision hook ( MODULE_NAME_provision_apache_vhost_config() ) to populating the $options variables that outputs in the vhost template file.

Before we roll our own solution, I am looking for anyone who has a better or existing solution. Is this a 'Aegir' way of solving this issue? We are happy to share the module once completed.

Thanks,
Stephan

Comments

do you meant serveraliases?

adrian's picture

because the site alias feature in aegir does that.

Alias

d1b1's picture

Adrian,

I am really hoping I have not looked right past an existing aegir feature on this one. The ServerAliases feature works great. We are working with path aliases. We have been asked to migrate in content (pdf, images etc) from other systems. In order to keep the existing domain urls working we have created a number of apache aliases. ex. alias /docs/uploaded /home/clients/myclient/files/

Thanks,
Stephan

Long Time ASP web developer, who has seen the light and is 100% committed to the drupal way of development.

Interesting

timwood's picture

Stephan,
I'm interested in your Aegir extension/module but I am wondering if using Apache's Rewrite rules instead of Aliases would be a more powerful, flexible solution. Have you thought of this?

-Tim

Apache Rewrite Rules

d1b1's picture

Tim,

I have not looked into rewrite rules. Mostly because I have been focused on aegir solutions. So far we have found that the vhost files provide the solution we require. Getting the file aliases into place in the vhost files seems like the logical solution. I should say that we are using aegir and a few tweaks as our provisioning system to a group of web heads. I know that there is some active development in the head of aegir for this feature. In the short term we have added in a tweaks that lets us call rsync to push sites, modules, vhost configs or the entire platform to each of the web heads. We are also working on an aegir task that will lets us start a graceful restart of each of the web heads. We would like to have the restart cascade. Meaning that it would restart or reload apache on one selected machine, and assuming it work, would move to the next and the next. We have found that an incorrect settings in the front end aegir options for a site can kill apache when it tried to reload.

Stephan

Long Time ASP web developer, who has seen the light and is 100% committed to the drupal way of development.

Symlinks?

steveoliver's picture

I sometimes create symlinks for paths that I want to share between Sites after settings up a Platform. While this is a simple manual step, it is a potentially unreliable step in my Aegir workflow. Since even broken symlinks won't prevent the web server from restarting, they are safer than Aliases, but I am looking for a solution for creating symlinks during Platform provision. Will be searching hooks/templates...

Aegir hosting system

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week