Index: [Article Count Order] [Thread]

Date:  Wed, 5 Mar 2008 13:38:44 -0800
From:  "Ken Marcus - Precision Web Hosting, Inc." <kenmarcus (at mark) precisionweb.net>
Subject:  [coba-e:12175] Re: Updating  from command line
To:  <coba-e (at mark) bluequartz.org>
Message-Id:  <041001c87f09$4ba42160$6700a8c0@OfficeKen>
References:  <200709280216.l8S2G4TY027333 (at mark) admin.xnet.com.mx> <1cf701c80189$7df5b0a0$6700a8c0 (at mark) OfficeKen> <1ea001c801f5$a8016c60$6700a8c0 (at mark) OfficeKen> <046801c87ea7$a7c6f010$7800000a (at mark) pc11>
X-Mail-Count: 12175


----- Original Message ----- 
From: "Steffan" <snoord (at mark) planet.nl>
To: <coba-e (at mark) bluequartz.org>
Sent: Wednesday, March 05, 2008 1:59 AM
Subject: [coba-e:12174] Re: Updating from command line


>i tried this script and works oke
> but the webaliases doesn't work anymore
> any upates on this
>
>
>
> Met vriendelijke groet,
>
> Steffan Noord
>
>
> -----
> When I moved the servers,  I actu8ally used the cmodvsite to change the IP
> addresses. That did work.
>
>
> The script I used was:
>
>
> #!/usr/bin/perl
> ##################################################################
> #changes the IP addreseses of the sites
>
> # /etc/httpd/conf/vhosts/site13
> #ServerAlias www.test.com test.com
> #/usr/sbin/cmodvsite --fqdn=www.test.com  --webAliases 
> www.test.com,test.com
>
>
> print "What IP address do you want to change all the sites to? ";
>
> $theipaddress = <STDIN>;
> $theipaddress  =~ s/ //g;
> chomp ($theipaddress);
>
> @locatearray=`ls -1 /home/sites`;
> &doit();
>
> sub doit {
> foreach $sitename (@locatearray) {
>     $aliases = "";
>     chomp ($sitename);
>     if   ($sitename eq "home" )  { } else {
>          ######### #get the site number
>          $ls=`ls -la /home/sites/ | grep $sitename`;
>          ($prev0, $prev1, $prev2, $prev3, $prev4, $prev5) =
> split(/\//,$ls);
>          chomp ($prev3);
>          $sitenumber = $prev3;
>          $conffile = "/etc/httpd/conf/vhosts/"."$sitenumber";
>          ######### cat that file and get the aliases then change ip and 
> set
>
> aliases
>          @cat=`cat $conffile`;
>          print "The conf file for $sitename  is $conffile\n";
>          foreach $line (@cat) {
>              chomp ($line);
>              if ($line =~ /ServerAlias/ ) {
>                 $line =~ s/ServerAlias//;
>                 @aliases = split(/ /,$line);
>                 $aliases = "@aliases";
>                 $aliases =~ s/^ //;
>                 $aliases =~ s/ /,/g;
>                 $justthedomain = $sitename;
>                 $justthedomain =~ s/www\.//;
>                 print "It shows the aliases as $aliases\n";
>              }
>          }
>          if ($theipaddress =~ /\d/) {
>                    system
> "/usr/sbin/cmodvsite --fqdn=$sitename  --webAliases=$aliases
> --ipaddr=$theipaddress");
>          } else {
>                    print "The IP address had no digits. It was [
> $theipaddress ]\n\n";
>                    exit;
>          }
>
>     }
>  }
> }
>
> exit;
>
>
>
>
>
>
>
Steffan

I don't know why that would be.  I have not seen that problem on the servers 
where I tried it.


----
Ken Marcus
Ecommerce Web Hosting by
Precision Web Hosting, Inc.
http://www.precisionweb.net