Current time: 12-23-2024, 02:45 PM Hello There, Guest! (LoginRegister)


Post Reply 
Tomcat Hosting
Author Message
unixar Offline


Posts: 1
Joined: May 2007
Reputation: 0
Post: #1
Tomcat Hosting
Is it possible to add tomcat support? Like using something like this script written in per: usage script.pl host home user group alias1 alias2 alias3
"I use this script to make my sites, I wonder if it can be integrated into ispc"
#!/usr/bin/perl -w

$tomcatdir = "/etc/tomcat5";

($host, $home, $vuid, $vguid, @aliases) = @ARGV;

print "Adding virtual host $host\n";
foreach $alias (@aliases) {
print "Adding alias $alias for $host\n";
}

print "Editing $tomcatdir/server.xml\n";

open (FILE, "$tomcatdir/server.xml") || die "Can't open server.xml";
open (NEWFILE, ">$tomcatdir/new-server.xml") || die "Can't open new-server.xml";

while ($buf = <FILE>) {

if ($buf =~ /VIRTUAL HOST INJECTION POINT/) {
print "Injecting $host\n";

print NEWFILE <<endvhost;

<Host name="$host" debug="0" appBase="$home"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase=""/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="$home/logs" prefix="$host\-tomcat." suffix=".log" timestamp="true"/>

endvhost
;

foreach $alias (@aliases) {
print NEWFILE "<Alias>$alias</Alias>\n";
}

print NEWFILE "</Host>\n\n";

}
print NEWFILE $buf;
}

close NEWFILE;
close FILE;

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time);
$now = ($year + 1900) . ($mon + 1) .
`mv $tomcatdir/server.xml $tomcatdir/server-\`date -Iseconds\`.xml`;
`mv $tomcatdir/new-server.xml $tomcatdir/server.xml`;

print "Making blank directory\n";

`mkdir $home/WEB-INF`;
`mkdir $home/WEB-INF/classes`;
`mkdir $home/WEB-INF/lib`;
`chown -R $vuid:$vgid $home/WEB-INF';

open (FILE, ">$home/WEB-INF/web.xml") || die "Can't open web.xml";

print FILE <<webapp;
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>
</web-app>

webapp
;

close FILE;

sleep(5);

print "Reloading Tomcat\n";
`/etc/init.d/tomcat5 force-reload`;
05-19-2007 04:52 PM
Find all posts by this user Quote this message in a reply
raphael Offline
Member
***

Posts: 474
Joined: Apr 2007
Reputation: 8
Post: #2
RE: Tomcat Hosting
I recommend you to open a ticket with milestone 1.1.0
05-20-2007 02:37 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)