How to Install ClamAV on CentOS 7 About ClamAV ClamAV is free open-source antivirus software that is used often and across several platforms. In this tutorial, we are going to teach you how to install ClamAV on CentOS 7. Prerequisites For this tutorial you are going to need: SSH root access to the VPS. Step 1 — Installing ClamAV on CentOS 7 Since Clam does not come with default CentOS software reports, you need to add the additional repository by running yum. yum -y install epel-release yum clean all Now install Clam on CentOS. Simply execute the command below. yum -y install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd You have now installed antivirus software on your server. Step 2 — Configuring SELinux SELinux is a security measure whose purpose it is to protect changes to certain files. You will need to perform futher configuration if you would like to use ClamAV with enabled SELinux kernel module. Without this, Clam is not able to read a portion of your files. Simply run the commands below. setsebool -P antivirus_can_scan_system 1 setsebool -P clamd_use_jit 1 To confirm these changes, execute the following command. getsebool -a | grep antivirus You should be receiving the output below or similar. antivirus_can_scan_system --&gt; on antivirus_use_jit --&gt; off Once this output is received, ClamAV is ready to use along with SELinux. Step 3 — Configuring ClamAV Before the Clam Configuration can be enabled, you have to remove the Example string from the configuration file. sed -i -e "s/^Example/#Example/" /etc/clamd.d/scan.conf Now, you will have to specify the server type. Open the configuration file with your favorite editor. In our example, we are going to use nano. If it isn’t currently installed, it must be installed with yum. yum install nano -y Open the configuration file. nano /etc/clamd.d/scan.conf Then, look for the following line. #LocalSocket /var/run/clamd.scan/clamd.sock Replace it with the line below. LocalSocket /var/run/clamd.scan/clamd.sock You may now save the changes by pressing on CTRL + X or COMMAND + X (If you are using a MAC). Before finishing you must delete the Example string from ClamAV’s freshclam update engine configuration file. sed -i -e "s/^Example/#Example/" /etc/freshclam.conf Then, execute the virus definition database update. freshclam You should be receiving the output below or similar. ClamAV update process started at Tue Dec 19 09:30:20 2016 main.cvd is up to date (version: 57, sigs: 4218790, f-level: 60, builder: amishhammer) Trying host database.clamav.net (18.104.22.168)... Downloading daily.cvd [100%] daily.cvd updated (version: 22739, sigs: 1100989, f-level: 63, builder: neo) Downloading bytecode-279.cdiff [100%] Downloading bytecode-280.cdiff [100%] Downloading bytecode-281.cdiff [100%] Downloading bytecode-282.cdiff [100%] Downloading bytecode-283.cdiff [100%] bytecode.cld updated (version: 285, sigs: 57, f-level: 63, builder: bbaker) Database updated (5319836 signatures) from database.clamav.net (IP: 22.214.171.124) Finally, start the Clamd service and run it on boot. systemctl start [email protected] systemctl enable [email protected] Conclusion You now have antivirus software on your server, this will help secure it a lot. Feel free to scan your server for malware and viruses. One more thing... Share this tutorial with your hosting administrators and networking experts' friends.
How to install Ioncube loader on cPanel servers[/caption] To start, you must decide if you want IonCube installed for your cPanel/WHM scripts or for your Apache/PHP scripts. It is pretty easy to find out if you require IonCube; the main use of IonCube is to access scripts from inside the /cPanel, /whm, or /webmail interface. If you require this, then you have to get IonCube. install Ioncube loader on cPanel servers Below, we will guide you through the steps for both.before going into details, Installing IonCube for cPanel/WHM/Webmail We have laid out both the GUI and the CLI methods below. Installing via the WHM To follow the steps below, you are required to have administrative privileges, usually the root password.Step 1: Begin by logging into WHM. This can be done by going to your servers’ IP followed by ‘/whm’ or ‘:2087’. For example: 'http://127.0.0.1:2087/'Step 2: Once viewing your servers’ IP, you will see a Tweak settings link on the left side, click on this.Step 3: Now, click on the PHP tab on the right-hand side.Step 4: Look for the configurable option called ‘cPanel PHP loader’ and check the ‘ioncube’ checkbox.Step 5: Lastly, click on ‘Save’. Installing via the CLI To follow the steps below, you will need to have shell access to the server as the user root.Step 1: Start by logging into the shell as the user root.Step 2: Modify ‘/etc/cpanel/cpanel.config’ and look for the line starting with ‘phploader=‘.If there is no value after the equal sign then all you have to do is add ‘ioncube’ to it. For example: ‘phploader=ioncube’.If there is another loader in place, just append your new loader by placing a comma before the additional loader. For example: ‘phploader=exampleloader,ioncube’.Step 3: Now, run the command: ‘/usr/local/cpanel/whostmgr/bin/whostmgr2 –updatetweaksettings’Step 4: Afterwards, execute this following command: ‘/usr/local/cpanel/bin/checkphpini’Step 5: And lastly, this command: ‘/usr/local/cpanel/bin/install_php_inis’ Installing IonCube Loader for Apache/PHP You have several ways to do this, they will all be listed below.Installing IonCube using the CLI version of PHPExtensionManagerThe following method is the one we recommend. It allows you to install the loaders without the need to rebuild Apache and PHP; this also makes it the quickest method.In this method, you will need shell access to the server as the user root via either the console, SSH, or any other means.Step 1: Begin by logging into the console as root.Step 2: Then, execute the following command: ‘/scripts/phpextensionmgr install IonCubeLoader’That is it. Simple and fast. Installing IonCube using the WHM In the next method, we will use the GUI version of easyapache to install the ioncube loader.If you are not interested in rebuilding Apache and PHP then do not use this method.Step 1: Start by logging into the WHM as the user root.Step 2: Once you are at the WHM interface, scroll down and the click on the ‘EasyApache’ link on the left-hand side.Step 3: Below ‘Profile’, choose ‘Previous Saved Config’ and click on the ‘Start customizing based on profile’ button.Step 4: Below ‘Apache Version’, find and click on ‘Next Step’Step 5: Now, below ‘PHP version’ again find and click on ‘Next Step’Step 6: Below the ‘Short Options list’, check the ‘ioncube Loader for PHP’ option and then click ‘Save and Build’.Step 7: This procedure may take a little while to finish; usually between 10-30 minutes depending on your hardware.ThanksDo let us know if you want to add any specific Linux or Web panels topics into this tutorial series.