2 # Enable or disable Apache modules
4 require './apache-lib.pl';
6 $access{'global'} == 1 || &error($text{'mods_ecannot'});
7 &error_setup($text{'mods_err'});
9 @mods = &list_configured_apache_modules();
10 %want = map { $_, 1 } split(/\0/, $in{'m'});
13 if ($want{$m->{'mod'}} && !$m->{'enabled'}) {
15 &add_configured_apache_module($m->{'mod'});
18 elsif (!$want{$m->{'mod'}} && $m->{'enabled'}) {
20 &remove_configured_apache_module($m->{'mod'});
25 # Force re-detection of modules
28 # Force restart Apache
29 if ($changed && &is_apache_running()) {
30 $err = &stop_apache();
31 &error($err) if ($err);
32 &wait_for_apache_stop();
33 $err = &start_apache();
34 &error($err) if ($err);