php - How to pass a multiline directive to apache using the -c parameter? -
i'm trying start apache command line, passing directive using "-c" parameter :
sudo httpd -c "<virtualhost *:80>\n</virtualhost>"
but fails :
httpd: syntax error in -c/-c directive: -c/-c directives:1: <virtualhost> not closed.
i tried passing multiline string using php through exec/system, fails :
<?php $directive = <<<eot <virtualhost *:80> </virtualhost> eot; exec("sudo httpd -c \"" . $directive . "\"");
is possible ?
yes possible !
-c / -c act 1 line in httpd.conf, can add many parameters lines :
sudo httpd -c "<virtualhost *:80>" -c "</virtualhost>"
Comments
Post a Comment