[Solved]Running EasyApache without first switching to Apache?

tina

Well-Known Member
#1
Is there a way to run EasyApache without first switching from LiteSpeed to Apache?

If we leave LiteSpeed running when we run EasyApache, it results in an error at the very end of the process, saying Apache is not running, and keeps reverting back to the old version.
 
Last edited by a moderator:

webizen

Well-Known Member
#2
We are aware of this. A plugin to circumvent this inconvenience is on its way and will be put together with 4.0.18 release.
 

tina

Well-Known Member
#5
tina: 4.0.18 is there. please test.
OK, tested on 3 machines.

2 machines ran the Apache restart tests correctly the 1st time.

1 machine did not switch to Apache the 1st time (so EasyApache failed), due to this error:

Switch to Apache
LSWS Stopped.
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Apache is not up within 30 secs, please try again.
We ran EasyApache on that machine for the 2nd time, and it switched to Apache correctly for the restart tests.

On all 3 machines, the matching PHP binaries for LiteSpeed could not be automatically built. The error message is as follows:

!! Executing custom hook '/scripts/before_httpd_restart_tests' !!

-- LiteSpeed WHM hooks begin: whm_before_httpd_restart_tests
Try to build matching php with LSAPI version 0,5.3.3
Try to build matching PHP via EasyApache hooks 0,5.3.3
Warning: exec() has been disabled for security reasons in /usr/local/cpanel/whostmgr/docroot/cgi/lsws/buildPHP.inc.php on line 18
Warning: Invalid argument supplied for foreach() in /usr/local/cpanel/whostmgr/docroot/cgi/lsws/buildPHP.inc.php on line 25
Cannot find configuration options!
Switch to Apache
LSWS Stopped.
Apache started successfully.
-- LiteSpeed WHM hooks end: whm_before_httpd_restart_tests
!! Done executing '/scripts/before_httpd_restart_tests' !!
We had to manually build the matching PHP binaries for all 3 machines.

Overall, other than the small hiccups described above, things went quite well, and we did not have to manually switch to Apache before running EasyApache on all 3 machines. :)
 

Lauren

LiteSpeed Staff
Staff member
#6
Warning: exec() has been disabled for security reasons in
Litespeed whm plugin will not work properly if exec is diabled, as many places require shell command execution. Please check
/usr/local/cpanel/3rdparty/etc/php.ini

and search for:
disable_functions =
remove exec from the list.
 

tina

Well-Known Member
#7
Litespeed whm plugin will not work properly if exec is diabled, as many places require shell command execution. Please check
/usr/local/cpanel/3rdparty/etc/php.ini

and search for:
disable_functions =
remove exec from the list.
exec() is not disabled in /usr/local/cpanel/3rdparty/etc/php.ini and 'disable_functions =' is empty (no value set).

If you check '/scripts/before_httpd_restart_tests' it is running '/usr/local/cpanel/whostmgr/docroot/cgi/lsws/whm_before_httpd_restart_tests.sh' which in turn runs '/usr/local/bin/php ./whm_buildPHP_hook.php $PHP_CSV' on line 20.

As you can see, it is using '/usr/local/bin/php' which is the main php that is being used by shared hosting accounts (which has exec() disabled for security reasons). So the script is not actually using cpphp (perhaps this is the bug?).

cpphp is located at '/var/cpanel/3rdparty/bin/php' but we are not sure if it is safe to change 'whm_before_httpd_restart_tests.sh' to use that instead. Would that fix the problem and is it safe to change it?
 

Lauren

LiteSpeed Staff
Staff member
#8
give a try, should work

update /usr/local/cpanel/whostmgr/docroot/cgi/lsws/whm_before_httpd_restart_tests.sh
replace /usr/local/bin/php with /usr/local/cpanel/3rdparty/bin/php

we'll update package on our side.

Thanks
 

tina

Well-Known Member
#9
give a try, should work

update /usr/local/cpanel/whostmgr/docroot/cgi/lsws/whm_before_httpd_restart_tests.sh
replace /usr/local/bin/php with /usr/local/cpanel/3rdparty/bin/php

we'll update package on our side.

Thanks
We tried replacing it and it does seem to work. Thanks! :)
 
Top