ispman/lib http.lib,1.63,1.63.2.1

Pedro Algarvio <[email protected]> Mon, 02 Oct 2006 08:09:40 +0000
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27827/lib

Modified Files:
      Tag: dev_1_3-cyrus_virtdomain
	http.lib 
Log Message:
Merged to current HEAD, still needs debuging though.


Index: http.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/http.lib,v
retrieving revision 1.63
retrieving revision 1.63.2.1
diff -u -d -r1.63 -r1.63.2.1
--- http.lib	2 May 2006 20:12:35 -0000	1.63
+++ http.lib	2 Oct 2006 08:09:38 -0000	1.63.2.1
@@ -14,7 +14,7 @@
         && -d "$vhostConfFile/conf" )
     {
         print
-"Apache configuration file directories did not exist. Creating now.\n";
+          "Apache configuration file directories did not exist. Creating now.\n";
         print "mkdir -p $vhostConfFile/conf\n";
         system "mkdir -p $vhostConfFile/conf\n";
         print "mkdir -p $vhostConfFile/hash\n";
@@ -201,7 +201,8 @@
 
         # don't provide any default because it would cover the error
     }
-    print "Setting logdir to $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'}\n";
+    print
+      "Setting logdir to $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'}\n";
 
     # build ispmanVhostStatdir
     if ( $vhostInfo->{'ispmanVhostStatdir'} =~ /\S/ ) {
@@ -228,13 +229,17 @@
 
         # don't provide any default because it would cover the error
     }
-    print "Setting statdir to $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'statdir'}\n";
+    print
+      "Setting statdir to $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'statdir'}\n";
 
     ### Check for log and stat dir and make them if need be
     unless ( -d $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'} ) {
-        print "Logdir $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'} did not exist. Creating now.\n";
-        print "mkdir -p $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'} \n";
-        system "mkdir -p $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'} \n";
+        print
+          "Logdir $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'} did not exist. Creating now.\n";
+        print
+          "mkdir -p $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'} \n";
+        system
+          "mkdir -p $vhostHash->{$ispmanDomain}{$ispmanVhostName}{'logdir'} \n";
     }
 
     write_vhosts_hash( "$vhostHashFile", $vhostHash );
@@ -268,11 +273,12 @@
 }
 
 sub make_vhosts_conf {
-    my $template      = shift;
     my $domain        = shift;
     my $vhostText     = "";
     my $vhostConfFile = $apacheVhostsFile;
     my $vhostHashFile = "$apacheVhostsFile.hash";
+    my $template      =
+      $ispman->getTemplate("$FindBin::Bin/../templates/vhosts.conf.template");
 
     if ( $ispman->getConf("apacheVhostsStyle") =~ /dir/m ) {
 
@@ -288,11 +294,11 @@
     } until sysopen( VHOSTS, $name, O_RDWR | O_CREAT | O_EXCL );
 
     print "Writing to tmpfile $name\n";
-    
+
     if ( $apacheVhostsHeader && -e $apacheVhostsHeader ) {
-    	print VHOSTS cat($apacheVhostsHeader);
+        print VHOSTS cat($apacheVhostsHeader);
     }
-    
+
     for my $domain ( keys %$vhostHash ) {
         for my $vh ( keys %{ $vhostHash->{$domain} } ) {
             next unless $vh =~ /\S/;
@@ -326,7 +332,8 @@
                   );
             }
             else {
-                $vhostHash->{$domain}{$vh}{'ispmanVhostDocumentRootOption'} = "";
+                $vhostHash->{$domain}{$vh}{'ispmanVhostDocumentRootOption'} =
+                  "";
             }
 
             if (
@@ -396,14 +403,14 @@
                           {'ispmanVhostRedirectURL'};
                     }
                     $urlredirectText .=
-"Redirect $vhostHash->{$domain}{$vh}{'urlredirect'}{$_}{'ispmanVhostRedirectURL'} $vhostHash->{$domain}{$vh}{'urlredirect'}{$_}{'ispmanVhostRedirectLocation'}\n";
+                      "Redirect $vhostHash->{$domain}{$vh}{'urlredirect'}{$_}{'ispmanVhostRedirectURL'} $vhostHash->{$domain}{$vh}{'urlredirect'}{$_}{'ispmanVhostRedirectLocation'}\n";
                 }
                 $vhostHash->{$domain}{$vh}{'urlredirect'} = $urlredirectText;
             }
 
             $vhostHash->{$domain}{$vh}{'ispmanDomain'} = $domain;
             $vhostHash->{$domain}{$vh}{'vhost'}        = $vh;
-            $vhostHash->{$domain}{$vh}{'ldapBaseDN'} =
+            $vhostHash->{$domain}{$vh}{'ldapBaseDN'}   =
               $ispman->{'Config'}{'ldapBaseDN'};
             $vhostHash->{$domain}{$vh}{'ldapHost'} =
               $ispman->{'Config'}{'ldapHost'};
@@ -446,7 +453,7 @@
     print VHOSTS "\n$vhostText\n";
 
     if ( $apacheVhostsFooter && -e $apacheVhostsFooter ) {
-    	print VHOSTS cat($apacheVhostsFooter);
+        print VHOSTS cat($apacheVhostsFooter);
     }
 
     close("VHOSTS");
@@ -470,7 +477,7 @@
     return 1;
 }
 
-sub reloadApache {
+sub reloadServer {
     my $apacheGracefulCommand      = $ispman->getConf("apacheGracefulCommand");
     my $apacheReloadCommand        = $ispman->getConf("apacheReloadCommand");
     my $apacheStopCommand          = $ispman->getConf("apacheStopCommand");


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV