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,7 +95,10 @@ install_vsftpd_server();
fail2ban_install();
if($webServerToInstall == "nginx" || ((isset($version) && $version != "12.10" && $distro == "ubuntu") || $distro == "debian")){
// Install both webserver packages
install_webserver_common();
if($webServerToInstall == "nginx"){
install_nginx_webserver();
}else{
installapacheserver();

View file

@ -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);

View file

@ -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/