I do not know if it is a bug, or just that I am doing something wrong, or that it was just never designed to work that way, but a directory put in templates-custom either under /VirtualHosts or under /httpd.conf (same level as VirtualHosts) seems to be ignored by expand-template in either case.
To solve my problem, did the following:
I installed the application in /usr/local/ledger-smb according to the developers instructions.
I created a virtual domain 'ledgers.imsig.ca' using server-manager and pointed it to the Primary ibay.
To have the right DocumentRoot directive (pointing to the application directory) I copied '20IbayContent' from the standard template location to the corresponding templates-custom location under /VirtualHosts. I then adjusted the code in the copy in the following manner:
{
if ($virtualHost eq "ledgers.imsig.ca")
{
$OUT = "";
$OUT .= " DocumentRoot /usr/local/ledger-smb\n\n";
}
else
{
... Standard 20IbayContent fragment code ...
}
}
The if...else structure that was added in front of the standard code inserts my custom DocumentRoot directive for the specified virtual domain and allows normal processing for the others.
I then created a '95ledger-smb' custom template fragment in the httpd.conf directory to hold the Directory directives for the key application directories.
I then created a '60WebRedirect' custom template fragment under VirtualHosts that contained a RewriteRule to force this virtual domain's access always to use https, like this.
#
# RewriteRule directives for LedgerSMB
#
RewriteEngine on
{
return "" unless $virtualHost eq "ledgers.imsig.ca" and $port ne "443";
'RewriteRule ^/(.*)$ https://ledgers.imsig.ca/$1 [R,L]';
}
I then expanded the templates and restarted Apache.
And it seems to work!
If anyone has suggestions for a better way to approach this, I would like to hear them. (The RewiteRule fragment looks a little awkward to me.)
My thanks to Cactus for pointing me in the right direction.
John