I am tagging this as a bug but you might want me to add it as a feature request as well.
Background: I created a site with no problem (usual Aegir goodness) - but I forgot to enable Site Aliasing in the Administer/Hosting menu first. Of course as soon as I tried the URL with www. on the front, I got a broken link.
I went into the Administer/Hosting menu and enabled the site aliasing and under the tab for Site aliases I enabled "Generate www.domain.com automatically".
This is the bug part:
When you then go to "Sites" and choose the site, it lists the www.sitename.com alias under Domain aliases on the View tab, just as you would expect - but if you click on that, you find it is a broken link and the URL is not accessible by a browser.
In an attempt to fix it, I then verified everything (the platform, server and sites) - watching for the ability to access the site under www. and none of the Verify runs physically created the alias either. I tried restarting apache and that had no effect. I think that what happens here is that all future sites will get the alias as part of the provisioning process, but once a site is already provisioned, you are out of luck when using the administration/hosting menu. I expected, especially in light of the following repair, that the verify would have created the alias.
The work-around and repair part is this:
I added the www. alias by going to Site/Edit and manually entering it in Domain Aliases. I then re-Verified the site. The result was that the symbolic link appeared in the sites directory, the browser was able to hit the site, the Site/View/Domain aliases link worked and the verify deleted the alias from the list of domain aliases in the Site/Edit/Domain aliases list. In fact, everything appeared to be exactly as it would have been had I remembered that I wanted to use aliasing in the first place. Very nice, as usual.
Here is the feature request part:
While this repair worked exactly the way I would ever want, my assumption is that you would not want someone to go through all of that. Instead, I would personally prefer that the change in the Hosting/Features screen would automatically enter the alias and then kick off a Verify run like above that results in the same resolution. That is, make sure that if an alias is properly selected using the Administration/Hosting/Features menu that it actually makes sure that the alias exists and is accessible. If the administrator then de-selects the alias in the Hosting menu the reverse would hold true and the alias would be removed from web sites that employed it. At that point, the site by site alias would be employed if the administrator desired some sites to have the alias and some sites not.
I hope I made all of that understandable.
Comments
Comment #1
Anonymous (not verified) commentedI can't reproduce that. If i enable Aliases and set 'generate www. prefix alias automatically', I don't see the alias in the site node view (just as I shouldn't)
I think you're expecting a little too much intelligence from the /admin/hosting/features areas: it is only setting variables in the variable table of Drupal. (it implements
system_settings_form())You don't expect Drupal to uninstall modules after Disabling them in /admin/build/modules, you go to 'Uninstall' and complete the job yourself. It's the same case here. We're not removing the functionality from the existing sites, we're disabling the ability to set it on new sites.
Nonetheless, I'll mark this as a feature request, but I see no bug here.
I have also added description text to the Aliases form saying something along the lines of
in case there was confusion there.
Comment #2
steven jones commentedComment #3
ergonlogicAs Mig5 reported in #1, I cannot reproduce this either.
I don't think it would too hard to register an 'enable' callback in the Hosting Alias feature to queue up verify tasks for all sites. But I don't think it would be the right place to do it. It seems to me that, if we want to do this, it'd be better done on saving the 'Site aliases' form (admin/hosting/aliases). Also, #1245198: Site alias settings should be available as a server setting would mean moving this queuing to the saving of a server node form.
Either way, it should probably wait for Aegir 3.
Comment #4
ergonlogicActually, I tested this again, and it appears to work fine.