From 0c256a036a1e2d990d9e39c53d8379c1b6510475 Mon Sep 17 00:00:00 2001 From: earnolmartin Date: Mon, 23 Oct 2023 17:06:22 -0600 Subject: [PATCH] Respect Selected Webserver Mode --- ehcp/install_2.php | 9 ++++++--- ehcp/install_lib.php | 26 ++++++++++++++++---------- ehcp/install_main.sh | 2 ++ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ehcp/install_2.php b/ehcp/install_2.php index a61e151..9708d9b 100755 --- a/ehcp/install_2.php +++ b/ehcp/install_2.php @@ -95,10 +95,13 @@ install_vsftpd_server(); fail2ban_install(); -if($webServerToInstall == "nginx" || ((isset($version) && $version != "12.10" && $distro == "ubuntu") || $distro == "debian")){ - install_nginx_webserver(); +// Install both webserver packages +install_webserver_common(); + +if($webServerToInstall == "nginx"){ + install_nginx_webserver(); }else{ - installapacheserver(); + installapacheserver(); } # scandb(); no more need to scan db since ver. 0.29.15 diff --git a/ehcp/install_lib.php b/ehcp/install_lib.php index 69d3952..8ed5c46 100755 --- a/ehcp/install_lib.php +++ b/ehcp/install_lib.php @@ -1279,16 +1279,13 @@ function rebuild_nginx_config2($mydir){ manageService("nginx", "restart"); } -function install_nginx_webserver(){ +function install_webserver_common(){ $mydir=getcwd(); global $app, $ehcpinstalldir; - # thanks to webmaster@securitywonks.net for encourage of nginx integration - echo "\nStarting nginx webserver install (not default)\n"; - #bekle(); - - // Stop apache if it is running so nginx will install... thanks Ubuntu - manageService("apache2", "stop"); + // Install apache2 stuff + aptget(array('libapache2-mod-php5','libapache2-mod-php','php5','php')); + aptget(array('apache2')); // Install nginx stuff aptget(array('nginx','php5-fpm','php-fpm','php5-cgi','php-cgi')); # apt-get install nginx php5-fpm php5-cgi @@ -1302,6 +1299,18 @@ function install_nginx_webserver(){ aptget($arrayOfPHPFPM); } } +} + +function install_nginx_webserver(){ + $mydir=getcwd(); + global $app, $ehcpinstalldir; + + # thanks to webmaster@securitywonks.net for encourage of nginx integration + echo "\nStarting nginx webserver install (not default)\n"; + #bekle(); + + // Stop apache if it is running so nginx will install... thanks Ubuntu + manageService("apache2", "stop"); copy("$mydir/etc/nginx/mime.types","/etc/nginx/mime.types"); @@ -1334,9 +1343,6 @@ function installapacheserver($apacheconf=''){ echo "\nStarting apache2 webserver install (default webserver)\n"; #bekle(__FUNCTION__." basliyor.."); - aptget(array('libapache2-mod-php5','libapache2-mod-php','php5','php')); - aptget(array('apache2')); - // We're configuring the apache server, but if the user switches to nginx later, we need to be partially setup for it... rebuild_nginx_config2($ehcpinstalldir); diff --git a/ehcp/install_main.sh b/ehcp/install_main.sh index f4540c2..44ec17a 100755 --- a/ehcp/install_main.sh +++ b/ehcp/install_main.sh @@ -449,6 +449,8 @@ function launchPanel(){ if [ ! -z "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then echo echo "The EHCP panel is now accessible!" + echo "Sleeping for 15 seconds to make sure any remaining ehcp daemon operations are completed..." + sleep 15s echo "Your panel administrative login is: admin" echo "Attempting to load the control panel via web browser from the local machine." sudo -u "$SUDO_USER" xdg-open http://localhost/