Archive for the ‘Linux’ Category

cPanel: Upgrade ClamAV to latest version

A new version of ClamAV was released recently.  Version 0.94.1 at the time of this writing. cPanel however is going to take some time to release the update. In the meantime you will keep getting messages like the following in your logwatch emails or when you try to manually update the clamav databases by using the ‘freshclam’ command.

WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.94 Recommended version: 0.94.1
DON’T PANIC! Read http://www.clamav.net/support/faq

If you are like me and like to keep your server software up to date, there is a simple way to upgrade to the latest version of ClamAV manually, on a cPanel powered server.

First, login to your server using SSH. Then use the following commands.

For 32 bit installations:
cd /usr/local/cpanel/modules-install/clamavconnector-Linux-i686

For 64 bit:
cd /usr/local/cpanel/modules-install/clamavconnector-Linux-x86_64

Then, download the source tarball of the latest version of ClamAV using wget. At the time of this writing, the latest version is 0.94.1. You can find the download link for the latest source at http://www.clamav.net/download/sources/

wget http://freshmeat.net/redir/clamav/29355/url_tgz/clamav-0.94.1.tar.gz

Now, open the file ‘install’. This file is located in the current directory, that is clamavconnector-Linux-i686 or clamavconnector-Linux-x86_64 depending on your OS architecture.

nano install

Find the line ‘AVV=0.94’ and change it to ‘AVV=0.94.1’
Find the line ‘AVVOLD=0.93.3’ and make it ‘AVVOLD=0.94’
The values in those lines will depend upon the version of your ClamAV. Save the ‘install’ file after making the changes.

Then edit the file ‘progversion’ and put the latest version of ClamAV there. You can do this with a simple command.

echo "0.94.1" > progversion

Finally, run the install script with the command ‘./install’.

And thats it. Your ClamAV should now get upgraded to the latest version.

After the installation is complete, remember to make sure that both ClamAV and the mail server are working fine.

In case anything goes wrong, you can always uninstall and reinstall ClamAV.

Installing and Configuring PPTP VPN on RHEL/CentOS 5

In the following tutorial, I will explain how to set up a PPTP VPN server on RHEL/CentOS 5, so that you can use it to browse the internet. So, if you have a RHEL/CentOS 5 dedicated server in US, you will be able to access US only sites.

A set up like this also has other benefits. Since the connection between the server and your computer will be encrypted, your ISP wont be able to intercept or track your internet usage.

Installation and Configuration

Ok, so lets get started. First make sure that you have ppp installed.

yum install ppp

In my case it was already installed, so I got the message ‘Package ppp – 2.4.4-1.el5.x86_64 is already installed’.

After you make sure that you have ppp installed, download and install Poptop. You can get the RHEL/CentOS 5 RPMs from http://poptop.sourceforge.net/yum/stable/rhel5/. I was using 64 bit version of CentOS 5. So I downloaded and installed the 64 bit (x86_64) version of the RPM.

wget http://poptop.sourceforge.net/yum/stable/rhel5/x86_64/pptpd-1.3.4-1.rhel5.1.x86_64.rpm

rpm -ivh pptpd-1.3.4-1.rhel5.1.x86_64.rpm

After installing Poptop, open the file /etc/pptpd.conf.

nano /etc/pptpd.conf

Go to the end of the file where you can see examples of localip and remoteip. Below them add your own values for localip and remoteip.

localip 10.0.0.1
remoteip 10.0.0.10-100

In the above, 10.0.0.1 will be used for the ppp interface and 10.0.0.10 – 10.0.0.100 will be assigned to the clients. You can also use different private IPs in ‘localip’ and ‘remoteip’, like 10.20.26.1 and 10.20.26.10-100. The OpenVPN documentation has some good info about numbering private subnets. Click here to check it out.

Next, open the file /etc/ppp/options.pptpd.

nano /etc/ppp/options.pptpd

Uncomment the ms-dns lines (by removing the ‘#’ in front of them) and change them to the dns servers provided by your ISP or to public DNS servers like ones provided by OpenDNS.

ms-dns 208.67.222.222
ms-dns 208.67.220.220

Thats all you need to change in the options.pptpd file. Next you will need to edit the file /etc/ppp/chap-secrets to add usernames and passwords for your clients. You need to enter the usernames and passwords in the following format.

# Secrets for authentication using CHAP
# client server secret IP addresses
username pptpd password *
username2 pptpd password2 *

You can also put a * in place of ‘pptpd’ just like there is a * below ‘IP addresses’. Also instead of a * below ‘IP addresses’ you can put the IP address from which the client will be connecting.

Read More