| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/home/SERVERWEB/webmin-2.105/apache/ |
Upload File : |
#!/usr/bin/perl
# restart.cgi
# Send a SIGHUP to apache
require './apache-lib.pl';
&ReadParse();
&error_setup($text{'restart_err'});
$access{'apply'} || &error($text{'restart_ecannot'});
$conf = &get_config();
if ($config{'test_config'}) {
$err = &test_config();
&error("<pre>".&html_escape($err)."</pre>") if ($err);
}
$err = &restart_apache();
&error($err) if ($err);
# Check if restart was successful.. some config file error may have caused it
# to silently fail
for($i=0; $i<5; $i++) {
if (&is_apache_running()) {
$running = 1;
last;
}
sleep(1);
}
if (!$running) {
# Not running.. find out why
$errorlogstr = &find_directive_struct("ErrorLog", $conf);
$errorlog = $errorlogstr ? $errorlogstr->{'words'}->[0]
: "logs/error_log";
if ($errorlog eq 'syslog' || $errorlog =~ /^\|/) {
&error($text{'restart_eunknown'});
}
else {
$errorlog = &server_root($errorlog, $conf);
$out = `tail -5 $errorlog`;
&error("<pre>$out</pre>");
}
}
&webmin_log("apply");
&redirect($in{'redir'});