简体   繁体   中英

Apache2 Perl vHosts Error

I just worked through this tutorial and modified the table by adding another column. I want to check the value before adding the template script. It didn't work and the script includes the template-ssl every time. It is important that this script works with MySQL, mass vhosts is not possible.

$My::dir = @row[3]; 
$My::encrypted = @row[4];
if ($My::encrypted == 'ssl') {
    $s->add_config(["Include /etc/apache2/sites-available/template-ssl"]);
}
else {
    $s->add_config(["Include /etc/apache2/sites-available/template-def"]);
}

I think the variables doesn't work but if(@row[4] == "ssl") also fire as true every time. Even when the DataRow contains "def".

Ok, it was too simple. The error was that you compare stings with "xx" eq "yy" and numbers with 1 == 2 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM