Open hifihedgehog opened 3 years ago
Note: this appears to be a previously unresolved, non-ticketed issue judging by the non-response from the Litespeed team to @hennaboy:
Note, this is what we currently see for OLS's environment PATH:
And it needs to be this:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
The real question here is how do we change the PATH variable environment for OpenLitespeed?
Based on this (https://openlitespeed.org/kb/server-environment-variables/), I tried to hard set the PATH environment variable but OpenLitespeed seems to ignore it:
I also tried editing the command section. That didn't work, either, but only because OpenLiteSpeed, unlike LiteSpeed, does not allow putting a path environment variable before the actual lsphp path.
For reference, in LiteSpeed, editing the command section would have worked since it allows adding a variable proceeding the path.
Based on the valuable information I was able to gather from @litespeedtech, what needs to change is the vHost Conf file that serves the CyberPanel content. Specifically, I would need to add an env variable under the extprocessor section. I can see the vHost Conf file for my websites (located /usr/local/lsws/conf/vhosts/
Hey, how would I effectively edit the vHost.conf for CyberPanel itself even though it does not seem to have one? I am trying to add a PATH env variable for one of CyberPanel's internal public sites, the ones served out of /usr/local/CyberCP/public, MailWatch. I can add a PATH env variable easily enough to the virtual host of one of my websites, but there is not a virtual host conf file for CyberPanel. So I tried adding a PATH env variable to the LSPHP socket for the entire server (/usr/local/lsws/conf/httpd_config.conf), but that doesn't affect CyberPanel's internal sites. Thoughts?
Fixed! Please add the following line at the end of /usr/local/CyberCP/public/mailwatch/mailscanner/conf.php:
putenv('PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin');
@hennaboy, here is your answer.
I am still hoping that I can find a way to change the LSPHP PATH variable for CyberPanel's internal sites, though. This should be easily done.
See above. The following text is shown at https://paneldomain/mailwatch/mailscanner/sf_version.php for Postfix. This appears to similar to the issue discussed here only that LiteSpeed is the web server in this case, requiring a different solution:
https://github.com/mailwatch/MailWatch/issues/1026