diff --git a/apache/CHANGELOG b/apache/CHANGELOG index a716130c3..1660390b3 100644 --- a/apache/CHANGELOG +++ b/apache/CHANGELOG @@ -39,3 +39,5 @@ Available Apache modules are now fully automatically detected on all operating s Moved the SSL password option to the global settings level, to correspond with the way Apache expects it. ---- Changes since 1.410 ---- 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 blocks under it are updated too. diff --git a/apache/save_vserv.cgi b/apache/save_vserv.cgi index 58a9f376b..ea603e30a 100755 --- a/apache/save_vserv.cgi +++ b/apache/save_vserv.cgi @@ -106,7 +106,26 @@ else { &save_directive("ServerName", $name ? [ $name ] : [ ], $vconf->{'members'}, $conf); - # write out file + # Update any blocks under the old path + if ($in{'root'} ne $in{'old_root'}) { + @dirs = &find_directive_struct("Directory", $vmembers); + foreach $dir (@dirs) { + if ($dir->{'words'}->[0] eq $in{'old_root'}) { + # Same dir + $dir->{'value'} = $in{'root'}; + } + elsif ($dir->{'words'}->[0] =~ /^\Q$in{'old_root'}\E(\/.*)$/) { + # Under the dir + $dir->{'value'} = $in{'root'}.$1; + } + else { + next; + } + &save_directive_struct($dir, $dir, $vconf, $vconf, 1); + } + } + + # Write out file &flush_file_lines(); &after_changing(); &unlock_file($vconf->{'file'}); diff --git a/apache/virt_index.cgi b/apache/virt_index.cgi index fdffacc3d..7ea87f2ec 100755 --- a/apache/virt_index.cgi +++ b/apache/virt_index.cgi @@ -102,6 +102,7 @@ if ($in{'virt'} && $access{'vaddr'}) { else { $addr = $val; } if ($addrs) { + # Multiple addresses and ports print &ui_table_row($text{'vserv_addrs'}, &ui_textarea("addrs", join("\n", split(/\s+/, $addrs)), 4, 30)); @@ -130,6 +131,7 @@ if ($in{'virt'} && $access{'vaddr'}) { &opt_input($root->{'words'}->[0], "root", $text{'vserv_default'}, 50). &file_chooser_button("root", 1, 1)); + print &ui_hidden("old_root", $root->{'words'}->[0]); # Server name $name = &find_directive("ServerName", $v->{'members'});