clamav command line install

cs_student

Registered
Apr 7, 2012
2
0
51
cPanel Access Level
Root Administrator
As a server administrator, I'm always dealing with websites which get hacked. I will use a program called maldet to scan a users home directory. For it to work best, I need clamav installed. I know I can go to the whm and add it; however, I wanted to know if there was a way to do it from the command line interface. This is purely for efficiency reasons.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
The issue with trying to install via command line is that it won't set the option in WHM > Manage Plugins area for "Install and keep updated" with clamavconnector. Can you explain why you would like to know how to do it in command line? Is there a slew of servers needing this added?

If you just want it added, which will cause it to be enabled in WHM > Service Manager (and will allow you to use "/scripts/restartsrv_clamd" to restart it), you can install using yum on CentOS or R:

Code:
yum install clamd
I wouldn't really recommend this route as it installs rpms rather than using our installer.
 

cs_student

Registered
Apr 7, 2012
2
0
51
cPanel Access Level
Root Administrator
Thank you very much for your reply.
I am aware of how to install it via yum. It is indeed on a CentOS server.
The reasons for this is indeed that I need to install it on many servers. I would like to use the cpanel installer to keep it updated and ensure everything works correctly with cpanel.

Is there no automated way I can do this through cpanel without logging into the whm web interface?
 

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
Is there no automated way I can do this through cpanel without logging into the whm web interface?
No, there is no way you can do this automatically through cPanel.
 

WiredChris

Member
Aug 7, 2013
8
0
1
cPanel Access Level
DataCenter Provider
Hi Tristan,

I'm looking for a way to enable to clamavconnector addon through the command line. I was given this one-liner which works but I don't always have the root password when logged into a server:
# curl -k -u 'root:RootPassword' 'https://myserver.com:2087/scripts2/saveuthemes?themetype=modules&clamavconnector=0.97.8-3.6'

It appears that the clamd package is only included in the EPEL which I don't wish to enable on any servers. I know I can grab the tar.bz2 from httpupdate.cpanel.net and extract it in the right place and run the install but I'm afraid this won't make cPanel keep it updated. I'd really like to have it installed through cPanel for the integration and updates. Is this going to be possible to do from the command-line?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello :)

There is no simple method to install this plugin via the command line. It's really better installed via Web Host Manager at this time. I agree that a script for managing the plugins via the command line would be a highly useful feature. I recommend submitting a feature request for this via:

Submit A Feature Request

Thank you.
 

WiredChris

Member
Aug 7, 2013
8
0
1
cPanel Access Level
DataCenter Provider
Hi Michael,

Thanks for your response. I've submitted a feature request but didn't receive any confirmation that it was submitted and I don't currently see it in my profile. This is my first feature request so I don't know what's supposed to happen. I'll re-submit if I don't see it appear later this week.

You say there's no "simple method", does that mean there's a complicated way? I see there's a PluginManager.pm module. My Perl-fu is weak but would it technically be possible to enable clamavconnector using this module or another? I've been looking for a good excuse to learn Perl...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
In addition, here is another note from that feature request that should be useful for other visitors to this thread:

cpaneltoddr Posted 1 day ago

Specifically after upgrading to edge, you can already do:

/scripts/update_local_rpm_versions --edit target_settings.clamav installed
/scripts/check_cpanel_rpms --fix --targets=clamav
Thank you.