Koozali.org: home of the SME Server
Obsolete Releases => SME Server 9.x => Topic started by: tolistim on September 18, 2018, 03:51:42 AM
-
I'm getting an error reported on my console with my httpd.conf. It's an "invalid if statement" at line 544. When I check 544, I see this:
if ( $port eq "80" && $virtualHost eq "support.bru.com")
# For redirection to support.bru.com.
Redirect / http://support.bru.com/ (http://support.bru.com/)
# skipping SSL directives
...
Should that be in the httpd.conf, or in the iBay configuration?
-
Here's my custom template for 25SSLDirectives in VirtualHosts:
if ( $port eq "80" && $virtualHost eq "support.bru.com")
{
$OUT .= " \n";
$OUT .= " # For redirection to support.bru.com.\n";
$OUT .= " Redirect / http://support.bru.com/\n";
}
{
return " # skipping SSL directives\n" unless $port eq "443";
return "" unless $modSSL{'status'} eq 'enabled';
$OUT = <<SSL_END;
# SSL Directives
SSLEngine on
SSL_END
}
However, that's not what is getting written into the httpd.conf file.
-
You need to enclose the if section in {}. Only stuff inside {} is evaluated as Perl code
-
Hi tolistim,
Daniel B. is right.
{
if ( $port eq "80" && $virtualHost eq "support.bru.com")
{
$OUT .= " \n";
$OUT .= " # For redirection to support.bru.com.\n";
$OUT .= " Redirect / http://support.bru.com/\n";
}
return " # skipping SSL directives\n" unless $port eq "443";
return "" unless $modSSL{'status'} eq 'enabled';
$OUT = <<SSL_END;
# SSL Directives
SSLEngine on
SSL_END
}
Michel-André