Update of /cvsroot/ispman/ispman/lib/ISPMan
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15610/lib/ISPMan
Modified Files:
ApacheMan.pm
Log Message:
upgrade to new logdir/statdir style
(remember to run ldifupdate to upgrade your LDAP data)
Index: ApacheMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan.pm,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- ApacheMan.pm 13 Feb 2004 22:33:50 -0000 1.50
+++ ApacheMan.pm 14 Feb 2004 19:39:06 -0000 1.51
@@ -282,6 +282,7 @@
} else {
# Atif 2003/01/13
# Should there be a check and stop here?
+ # jdelker: check? stop? why? webhosts has content in this branch.
}
@@ -302,7 +303,10 @@
'gidNumber' => $domain_info->{'gidNumber'},
"ispmanDomain" => $domain,
"uid" => (join '.' , ($r->param("ispmanVhostName"), $r->param("ispmanDomain"))),
- "homeDirectory" => (join '/' , ($domain_info->{'homeDirectory'}, "vhosts", $r->param("ispmanVhostName"))),
+ "homeDirectory" => $r->param("homeDirectory") ||
+ (join "/",($domain_info->{'homeDirectory'},
+ "vhosts",
+ $r->param("ispmanVhostName"))),
"userPassword" => $self->encryptPassWithMethod($r->param("userPassword"),$self->getConf('userPassHashMethod')),
"ispmanVhostServerAlias" => $r->param("ispmanVhostServerAlias") || "",
"FTPStatus" => $r->param("FTPStatus") || "",
@@ -313,34 +317,29 @@
};
$data->{"ispmanVhostExtraConf"} = $r->param("ispmanVhostExtraConf") if $r->param("ispmanVhostExtraConf");
- $data->{"ispmanVhostDocumentRoot"} = $r->param("ispmanVhostDocumentRoot") || join '/', ($r->param("ispmanVhostName"), "htdocs");
- $data->{"ispmanVhostScriptDir"} = $r->param("ispmanVhostScriptDir") || join '/', ($r->param("ispmanVhostName"), "cgi-bin");
+ $data->{"ispmanVhostDocumentRoot"} = $r->param("ispmanVhostDocumentRoot") || "htdocs";
+ $data->{"ispmanVhostScriptDir"} = $r->param("ispmanVhostScriptDir") || "cgi-bin";
$data->{"ispmanVhostIpAddress"} = $r->param("ispmanVhostIpAddress") || $self->getConf("apacheVhostsIP") || "*";
$data->{"webHost"} = $webhosts;
$data->{"fileHost"} = $r->param("fileHost") || $domain_info->{'ispmanDomainDefaultFileServer'};
$data->{"DestinationAddress"} = $r->param("fileHost") || $domain_info->{'ispmanDomainDefaultFileServer'};
- ### STAT AN LOG DIR ###
- ### Upgrade to make sure there is a value
- if ($r->param("ispmanVhostLogdir") ne "") {
- $data->{"ispmanVhostLogdir"} = $r->param("ispmanVhostLogdir");
+ my $substmap={
+ vhost => $r->param("ispmanVhostName"),
+ domain => $r->param("ispmanDomain")};
+
+ # process ispmanVhostLogdir
+ if ($r->param("ispmanVhostLogdir")) {
+ $data->{"ispmanVhostLogdir"} = $r->param("ispmanVhostLogdir");
} else {
- if (lc($self->getConf('apacheLogsDirectory')) eq 'none') {
- $data->{"ispmanVhostLogdir"} = join "/",($domain_info->{'homeDirectory'},"vhosts", $r->param("ispmanVhostName"), "logs");
- } else {
- $data->{"ispmanVhostLogdir"} = $r->param("ispmanVhostLogdir") || join "/", ($self->getConf('apacheLogsDirectory'), "vhosts");
- }
+ $data->{"ispmanVhostLogdir"} = $self->substitute($self->getConf('apacheLogsDirectory'),$substmap);
}
- ### Upgrade to make sure there is a value
- if ($r->param("ispmanVhostStatdir") ne "") {
- $data->{"ispmanVhostStatdir"} = $r->param("ispmanVhostStatdir");
+ # process ispmanVhostStatdir
+ if ($r->param("ispmanVhostStatdir")) {
+ $data->{"ispmanVhostStatdir"} = $r->param("ispmanVhostStatdir");
} else {
- if (lc($self->getConf('apacheLogsDirectory')) eq 'none') {
- $data->{"ispmanVhostLogdir"} = join "/",($domain_info->{'homeDirectory'},"vhosts", $r->param("ispmanVhostName"), "stats");
- } else {
- $data->{"ispmanVhostStatdir"} = $r->param("ispmanVhostLogdir") || join "/", ($self->getConf('apacheLogsDirectory'),"domains", $data->{"ispmanDomain"}, $data->{"ispmanVhostName"});
- }
+ $data->{"ispmanVhostStatdir"} = $self->substitute($self->getConf('apacheStatDirectory'),$substmap);
}
# write data to LDAP
@@ -379,7 +378,7 @@
}
}
}
-
+
# add process for each webhost
for (@$webhosts){
$self->addProcessToHost($r->param("ispmanDomain"),
@@ -395,7 +394,7 @@
"AddVirtualHostDirectories",
join ",", (
$r->param("ispmanVhostName"),
- $domain_info->{'homeDirectory'},
+ $data->{'homeDirectory'},
$data->{"ispmanVhostDocumentRoot"},
$data->{"ispmanVhostScriptDir"},
$data->{'uidNumber'},
@@ -438,7 +437,7 @@
"DeleteVirtualHostDirectories",
join ",", (
$ispmanVhostName,
- $domainInfo->{'homeDirectory'},
+ $vhostInfo->{'homeDirectory'},
$vhostInfo->{"ispmanVhostDocumentRoot"},
$vhostInfo->{"ispmanVhostScriptDir"},
$vhostInfo->{"ispmanVhostLogdir"},
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.