mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Fix <directory> when updating document root
This commit is contained in:
@@ -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 <directory> blocks under it are updated too.
|
||||
|
||||
@@ -106,7 +106,26 @@ else {
|
||||
&save_directive("ServerName", $name ? [ $name ] : [ ],
|
||||
$vconf->{'members'}, $conf);
|
||||
|
||||
# write out file
|
||||
# Update any <Directory> 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'});
|
||||
|
||||
@@ -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'});
|
||||
|
||||
Reference in New Issue
Block a user