Added support for the funny ${APACHE_RUN_USER} and ${APACHE_PID_FILE} variables seen in apache2.conf on Ubuntu 8.04.
---- Changes since 1.430 ----
When a virtual host's base directory is changed, all <directory> blocks under it are updated too.
+When stopping and re-starting Apache, give it time to fully stop before continuing.
# Call stop and start functions
local $err = &stop_apache();
return $err if ($err);
+ local $stopped = &wait_for_apache_stop();
local $err = &start_apache();
return $err if ($err);
}
}
}
+# wait_for_apache_stop([secs])
+# Wait 30 (by default) seconds for Apache to stop. Returns 1 if OK, 0 if not
+sub wait_for_apache_stop
+{
+local $secs = $_[0] || 30;
+for(my $i=0; $i<$secs; $i++) {
+ return 1 if (!&is_apache_running());
+ sleep(1);
+ }
+return 0;
+}
+
# configurable_modules()
# Returns a list of Apaches that are compiled in or dynamically loaded, and
# supported by Webmin.