usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.55k stars 600 forks source link

Postfix Version: postconf not found #466

Open hifihedgehog opened 3 years ago

hifihedgehog commented 3 years ago

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

hifihedgehog commented 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:

https://forum.openlitespeed.org/threads/env-path.4341/

hifihedgehog commented 3 years ago

Note, this is what we currently see for OLS's environment PATH:

image

And it needs to be this:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin

hifihedgehog commented 3 years ago

The real question here is how do we change the PATH variable environment for OpenLitespeed?

hifihedgehog commented 3 years ago

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:

image

hifihedgehog commented 3 years ago

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.

image

For reference, in LiteSpeed, editing the command section would have worked since it allows adding a variable proceeding the path.

image

hifihedgehog commented 3 years ago

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/, as stated here: https://cyberpanel.net/docs/location-of-configuration-files/) except for the vHost Conf for CyberPanel itself. Where is the vHost Conf file for the CyberPanel's own internal sites like Rainloop and MailWatch? To fix this, we would need to add the PATH env variable there to CyberPanel's vHost Conf.

hifihedgehog commented 3 years ago

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?

hifihedgehog commented 3 years ago

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.

hifihedgehog commented 3 years ago

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.