Respect Selected Webserver Mode

This commit is contained in:
earnolmartin 2023-10-23 17:06:22 -06:00
parent f0f7475dc3
commit 0c256a036a
3 changed files with 24 additions and 13 deletions

View file

@ -95,10 +95,13 @@ install_vsftpd_server();
fail2ban_install(); fail2ban_install();
if($webServerToInstall == "nginx" || ((isset($version) && $version != "12.10" && $distro == "ubuntu") || $distro == "debian")){ // Install both webserver packages
install_nginx_webserver(); install_webserver_common();
if($webServerToInstall == "nginx"){
install_nginx_webserver();
}else{ }else{
installapacheserver(); installapacheserver();
} }
# scandb(); no more need to scan db since ver. 0.29.15 # scandb(); no more need to scan db since ver. 0.29.15

View file

@ -1279,16 +1279,13 @@ function rebuild_nginx_config2($mydir){
manageService("nginx", "restart"); manageService("nginx", "restart");
} }
function install_nginx_webserver(){ function install_webserver_common(){
$mydir=getcwd(); $mydir=getcwd();
global $app, $ehcpinstalldir; global $app, $ehcpinstalldir;
# thanks to webmaster@securitywonks.net for encourage of nginx integration // Install apache2 stuff
echo "\nStarting nginx webserver install (not default)\n"; aptget(array('libapache2-mod-php5','libapache2-mod-php','php5','php'));
#bekle(); aptget(array('apache2'));
// Stop apache if it is running so nginx will install... thanks Ubuntu
manageService("apache2", "stop");
// Install nginx stuff // Install nginx stuff
aptget(array('nginx','php5-fpm','php-fpm','php5-cgi','php-cgi')); # apt-get install nginx php5-fpm php5-cgi 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); 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"); 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"; echo "\nStarting apache2 webserver install (default webserver)\n";
#bekle(__FUNCTION__." basliyor.."); #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... // 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); rebuild_nginx_config2($ehcpinstalldir);

View file

@ -449,6 +449,8 @@ function launchPanel(){
if [ ! -z "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then if [ ! -z "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then
echo echo
echo "The EHCP panel is now accessible!" 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 "Your panel administrative login is: admin"
echo "Attempting to load the control panel via web browser from the local machine." echo "Attempting to load the control panel via web browser from the local machine."
sudo -u "$SUDO_USER" xdg-open http://localhost/ sudo -u "$SUDO_USER" xdg-open http://localhost/