3 # Send a SIGHUP to apache
5 require './apache-lib.pl';
7 &error_setup($text{'restart_err'});
9 $access{'apply'} || &error($text{'restart_ecannot'});
10 $conf = &get_config();
12 if ($config{'test_config'}) {
13 $err = &test_config();
14 &error("<pre>".&html_escape($err)."</pre>") if ($err);
16 $err = &restart_apache();
17 &error($err) if ($err);
19 # Check if restart was successful.. some config file error may have caused it
21 for($i=0; $i<5; $i++) {
22 if (&is_apache_running()) {
29 # Not running.. find out why
30 $errorlogstr = &find_directive_struct("ErrorLog", $conf);
31 $errorlog = $errorlogstr ? $errorlogstr->{'words'}->[0]
33 if ($errorlog eq 'syslog' || $errorlog =~ /^\|/) {
34 &error($text{'restart_eunknown'});
37 $errorlog = &server_root($errorlog, $conf);
38 $out = `tail -5 $errorlog`;
39 &error("<pre>$out</pre>");
43 &redirect($in{'redir'});