Disclaimer: This might work, I have not tested it.
First create the directory structure needed for the custom-template fragments:
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
Copy the original template fragments that need to be customize to the same relative location in the custom-templates tree:
cd /etc/e-smith/templates-custom/etc/httpd.conf/httpd/conf/
cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/80VirtualHosts .
cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/25SSLDirectives VirtualHosts/
If no other custom template fragments are present for httpd.conf your custom-template tree should now look like this:
[root@smetest httpd.conf]# ls -R
.:
80VirtualHosts VirtualHosts
./VirtualHosts:
25SSLDirectives
[root@smetest httpd.conf]#
Now edit the copied fragments with your favorite editor. Let's start with the 80VirtualHosts fragment.
Change the following line:
foreach my $port (qw(80 443))
to:
my $sslport = $domain->prop('SSLPort') || '443';
my @ports = 80;
push (@ports, $sslport);
foreach my $port (@ports)
And below this line:
port => $port,
add the following line:
sslport => $sslport,
Now save this file as you are done with it.
On with the second file (./VirtualHosts/25SSLDirective):
Change the following line:
return " # skipping SSL directives\n" unless $port eq "443";
to
return " # skipping SSL directives\n" unless $port eq $sslport;
Now save this file as you are done with it.
We have now created custom-template fragments that superseed the original template fragments when the configuration file is generated. The template fragment take a additional parameter from the domains database that specifies the SSL port to use for the domain, if none is provided the default port (443) will be used.
To modify the port number for a domain you can add/modify the SSLPort property in the domains database like this:
db domains setprop domain.tld SSLPort portnumber
Make sure to replace the domain.tld with the domain name you defined in server-manager as well as to set the port number you desire the https domain to be listening on.
After you have defined the port number you need to regenerate the configuration file and restart the web server, this can be done with the following command:
signal-event domain-modify
To remove the custom template fragments and restore SME Server's default behavior you just need to remove the custom-template fragments like this:
rm /etc/e-smith/templates-custom/etc/httpd.conf/httpd/conf/80VirtualHosts
rm /etc/e-smith/templates-custom/etc/httpd.conf/httpd/conf/VirtualHosts/25SSLDirective
signal-event domain-modify