[BlueOnyx:14250] Re: Killing Java / Tomcat

Michael Stauber mstauber at blueonyx.it
Fri Jan 10 10:22:17 -05 2014


Hi Chris,

> There are some servers where running Tomcat becomes more of a liability 
> than an asset.  Is there any reason why a "yum remove java" would be 
> harmful?   I don't see any dependencies that would cause harm elsewhere.

You'd actually want to remove base-java* to take away the GUI bits and
pieces of Java, too.

However, a "yum remove base-java*" will also remove
base-alpine-capstone, which you need.

Lastly, the current base-swupdate that's currently in the testing
repository has YUM run a "yum groupinstall blueonyx" after each YUM
update. This is done to ensure that your install is complete. And it'll
bring back Java. All of it.

> On a related note, we were working with a customer who wanted not to see 
> any Tomcat processes working on his server.   It was cumbersome to go 
> through each site in the Virtual Site List, click to Web and see if the 
> "JSP" box was checked or not.    I wonder if there could be a function 
> to make global or mass changes in some future release.

Let me roll this in my head for a bit to see what can be done. Your
other recent idea of having the choice to disable usage of regular PHP
and to only leave suPHP as an option for new sites already got me
thinking in that direction.

So here is what's most likely going to happen in one form or another:

There will be a GUI page on which the server admin can select which
kinds of services will be available for Vsites and which services he
deliberately doesn't want to provide. This is needed now that we have
"reseller" accounts and people other than the server admin can create
Vsites.

On that new page you'll be able to turn off things you don't want to
provide. Which usually would include shell accounts, anon-FTP, regular
PHP and Java. But why stop there and not extend it to the full list of
features? So I'll extend that to all services that can be turned off.

I'll make sure that this not only prevents creating new sites with these
features, but it'll also turn the corresponding services off for sites
which (by accident or intent) already use them.

As for a script that disables Java on all Vsites, you can use this:

---------------------------------------------------
#!/usr/bin/perl -I/usr/sausalito/perl

use CCE;
my $cce = new CCE;
$cce->connectuds();

# Find all Vsites:
my @vhosts = ();
my (@vhosts) = $cce->findx('Vsite');

# Walk through all Vsites:
for my $vsite (@vhosts) {
    ($ok, my $my_vsite) = $cce->get($vsite);

    print "\nDisabling Java for Site $my_vsite->{fqdn}\n";

    # Turn Java off:
    ($ok) = $cce->set($vsite, 'Java', {'enabled' => "0"});

}

$cce->bye('SUCCESS');
exit(0);
---------------------------------------------------

Once all Vsites have Java disabled and once you have set a master
password for Tomcat under "System Settings" / "Server" / "Java", all
Tomcat related processes will stop by itself.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list