// from Internet uses } else { print " Accessible from Internet = NO\n"; // Not connected or } if (get_cron_tracker() == "run") { // Is cron running print " Cron run status = Running\n"; } else { print " Cron run status = Not running\n"; } print " PHP INI: php.ini file = " . get_php_tracker() . "\n\n"; print " APACHE SERVER:\n\n"; print " Apache port = " . get_apache_port() . "\n"; print " Apache SSL port = " . get_apache_ssl_port() . "\n"; print " Apache executable name = " . get_apache_exe() . "\n"; print " Apache service name = {$us_apache_service_name}\n"; if (ssl_enabled()) { print " Apache SSL server = Enabled\n"; } else { print " Apache SSL server = Disabled\n"; } // Check was PC switched off while server running if (!apache_running() && get_apache_tracker() == "program") { set_apache_tracker('free'); } if (apache_running() && get_apache_tracker() != "free") { print " Apache run status = Running\n"; if (get_apache_tracker() == "service") { print " Apache install status = Installed as a service\n"; }
echo " SSL not enabled skipping port test.\n"; } //======================================== END Port test if ($failed || !apache_syntax_check()) { if ($failed) { echo " Failed! To install Apache service both ports must be free!\n"; } if (!apache_syntax_check()) { echo " Failed! Please correct Apache config file errors!\n"; } } else { // Free to run server //=== Start service =========================== echo " Installing {$us_apache_service_name} Service ...\n\n"; // Inform user $Apache_exe = get_apache_exe(); $cmd = "{$us_apache_bin}/{$Apache_exe} -k install -n \"{$us_apache_service_name}\""; exec($cmd, $dummy, $return); // Install service $cmd = "net start {$us_apache_service_name}"; exec($cmd, $dummy, $return); // Start service set_apache_tracker('service'); // Set tracker to 'service' Prevents // a user installing as a standard program. //=== End Start service =========================== //=== Start index page ======================================================= if ((int) $server_operation & 4) { // Enabled by config or parameter $command = 'start ' . $usf_redirect; // index page and automaticaly start
function apache_syntax_check() { global $us_apache_bin; $apache_exe = get_apache_exe(); // Apache program $cmd = "{$us_apache_bin}/{$apache_exe} -t"; // Command print " Apache Syntax check - "; exec($cmd, $dummy, $return); // Run syntax check if ($return == 1) { // 0=OK 1=errors return false; // Errors found } else { return true; // No errors found } }
print "<h3>" . $US['service-apache-head1'] . "</h3>"; print "<p>" . $US['service-apache-txt1'] . "</p>"; print "<p>" . $US['service-apache-txt2'] . "</p>"; print '<form name="form" action="' . $file_name . '" method="post">'; print '<input type="submit" name="Apache_confirm" value="' . $US['service-confirm-button'] . '"></font>'; print "</form>"; print "</div>"; } if (@$_POST['Apache_confirm'] == $US['service-confirm-button']) { // Confirmed by user restart Apache service print "<h2>» " . $US['service-apache-head1'] . "</h2>"; print "<h3>" . $US['service-apache-head2'] . "...</h3>"; print "<p>" . $US['service-apache-txt3'] . "</p>"; print "<p>" . $US['service-apache-txt4'] . "</p>"; //=== Restart Apache services $cmd = "start {$us_apache_bin}/" . get_apache_exe() . " -k graceful"; pclose(popen($cmd, 'r')); // detatch and run command print "</div>"; } //=== User clicked the confirmation link. // When the above page times out it calls this refresh page which forces // a complete Apanel reload. If Apache ports had been changed links // reflect this change. Hence a full index page reload. if (@$_GET['sel'] == 'A2') { // Apache service print "<script language=\"javascript\">"; print "top.location.href = \"http://{$a}/apanel/index.php\";"; print "</script>"; print "</div>"; }
# Server port $Apache_port = $Apache_port_old + 1; # New Server port # Avoid these ports if ($Apache_port == $avoid1 || $Apache_port == $avoid2) { $Apache_port = $Apache_port + 1; } $Apache_ssl_port_old = get_apache_ssl_port(); # SSL Server port $Apache_ssl_port = $Apache_ssl_port_old + 1; # New SSL Server port # Avoid these ports if ($Apache_ssl_port == $avoid1 || $Apache_ssl_port == $avoid2) { $Apache_ssl_port = $Apache_ssl_port + 1; } $Apache_name_old = get_apache_exe(); # Apache executable name # New Apache executable name if (preg_match("/([a-zA-Z]+)(\\d*)(\\.exe)/", $Apache_name_old, $matches)) { $Apache_name = $matches[1] . ($matches[2] + 1) . $matches[3]; } $Apache_service_name_old = $us_apache_service_name; # Apache original service name # Apache New service name if (preg_match("/([a-zA-Z]+)(\\d*)/", $Apache_service_name_old, $matches)) { $Apache_service_name = $matches[1] . ($matches[2] + 1); } $MySQL_port_old = get_mysql_port(); # Server port $MySQL_port = $MySQL_port_old + 1; # New Server port