Preventing Spam with Antivirus.exim
Posted on December 23, 2009
Filed Under Linux Hosting, VPS hosting | 1 Comment
Dedicated servers with cPanel installed have an antivirus called as antivirus.exim. Antivirus Exim has a main central filter for the exim mail server which enables you to setup all kinds of wonderful filters to help stop spams from coming in and going out of your server.
Here is the config /etc/antivirus.exim config file. This will help protect to you and therefore protect me as well because your server might be spamming mine one day.
First off the default /etc/antivirus.exim config has few different rule sets in it. The main ones are attachment filters to help stop email viruses from your users. They stop things like .src and .com and .exe attachments.
This shows you some rules to stop spammers from sending out of your Dedicated server, you can also use it to stop spam from imcoming traffic. I do not go into a lot of detail for filtering incoming mail since other applications like Spam Assassin handle that in a better way.
Basic requirement is you will need a root access to your Cpanel server as usual.
First off we need to create a special log file for these filters do this:
touch /var/log/filter.log
chmod 0644 /var/log/filter.log
Now open up the configuration file
vi /etc/antivirus.exim
It should have a whole whack of comments at the top.
It is very simple now add this to your existing file, save the changes and they take effect immediately.
IP Allocation report 2009
Posted on August 14, 2009
Filed Under VPS hosting, Web-hosting | 1 Comment
Throughout the world IP addresses are allocated to more than 238 countries in the world and this process is called IP address allocation. Staring from the first allocation process to the latest allocation in 2009 one point that attracts everyone is the uneven distribution of IP address. There are numerous reasons starting from money to political barriers. The allocation for the year 2009 seems more uneven than the previous ones. According to the reports of IP allocation 2009, supreme power of the world United States holds 37.17% of the total IP addresses worldwide. Second on the list are mighty British i.e. United Kingdom with 11.37% of the total. On third place is leader of the developing countries China holding about 7.08%. In the far east, land of the rising sun Japan got 6.95% of the total IP’s. Germany is allocated 4.01% IP addresses. France, tourist capital of the world is having 3.75% total addresses. Surprise entry in the top 10 list is Korean countries, North Korea and South Korea with 2.91 percent. Canada got 2.66%, while Dutch (Netherland) have 1.91%. Pizza and Ferrari homeland Italy is tenth with 1.77%. It can be clearly observed from the report that 80% of the total IP addresses are allocated to 10 countries while rest 228 countries shares mere 20 %. Thus this report verifies Pareto Principle.

Cpanel Error
Posted on March 10, 2009
Filed Under Web-hosting | Leave a Comment
I just found an error
http://www.cpanel.net/plugins/devel/install.html
Uninstalling Plugins
If a Plugin is no longer needed, it can be uninstalled with the following command:
* /usr/local/cpanel/bin/unregister_plugin
There is no such file
/usr/local/cpanel/bin/unregister_plugin
It should be
/usr/local/cpanel/bin/unregister_cpanelplugin
Steps to install powerDNS on VPS
Posted on March 8, 2009
Filed Under Linux Hosting, VPS hosting, Windows VPS | Leave a Comment
What is powerDNS?
PowerDNS: It stands for Power Domain Nameservers. Power DNS is written in C++ language and it is licensed under the GPL. This Power DNS is setup on Linux as well as Windows OS. PowerDNS updates your DNS information (if your DNS is hosted at TextDrive) according to your domains set up in webmin. If you don’t use powerDNS then, you have to first set up the domain so that Apache knows about it then go to your DNS info and make it point at your server.
1) In order, to install PowerDNS on your VPS you will require several modules that is PHP(if you are going to install PowerAdmin web client too) Mysql, DB and MDB2. You can easily Install PHP, MySQL and other required modules by following the below commands:-
yum install mysql mysql-devel mysql-server -y
yum install php-devel php-imap php-pear php-ldap php-gd php-mbstring php-ncurses php-xmlrpc php-domxml php-mysql php-odbc
pear install DB
pear install pear/MDB2#mysql
2) After the installation of modules, you will have to create Database for PDNS. First login to MySQL Console using mysql root password and execute following query to create database:-
mysql> create database power_admin;
Note: You can create any user as a database user for power_admin. Here I have used root.
3) Now next you will need to create Empty tables inside this database. Following are the SQL Queries to create tables
use power_admin;
create table domains (
id INT auto_increment,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
primary key (id)
);
CREATE UNIQUE INDEX name_index ON domains(name);
CREATE TABLE records (
id INT auto_increment,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(6) DEFAULT NULL,
content VARCHAR(255) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
primary key(id)
);
CREATE INDEX rec_name_index ON records(name);
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
create table supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);
GRANT SELECT ON supermasters TO power_admin;
GRANT ALL ON domains TO power_admin;
GRANT ALL ON records TO power_admin;
Steps to Install and Configure PDNS on VPS are as follows:-
1) PowerDNS can be installed using YUM or using by the RPM provided by PowerDNS. Following is the command to install PDNS using yum
yum install pdns pdns-backend-mysql
2) Once it is installed you can configure PDNS to work with MySQL Server. Open file /etc/pdns/pdns.conf which is configuration file for PDNS and search for “launch=bind” and change
FROM:
#################################
# launch Which backends to launch and order to query them in
#
launch=bind
bind-example-zones
TO:
#################################
# launch Which backends to launch and order to query them in
#
#launch=bind
#bind-example-zones
launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=root
gmysql-password=root_password
gmysql-dbname=power_admin
Once the above configuration is done please save and exit from the file.
3) By using the command “service pdns restart” restart the service. Once it is restarted check that the server is responding to port 53 i.e. Port for DNS service. You can check that using telnet i.e. “telnet localhost 53?.
telnet Install and Configure PowerDNS with MySQL.
Now Power DNS is successfully installed on your VPS.
Rootkit Hunter on Linux VPS
Posted on March 6, 2009
Filed Under Linux Hosting, VPS hosting | Leave a Comment
What is RKHunter?
RKHunter stands for Rootkit Hunter. It’s one of the most powerful application that you can install easily on your Cpanel VPS.
As rootkits are installed into system files they cannot be removed easily however, RKHunter will still notify you of any rootkits that may exist in your system so that you can take the necessary steps to reload your cPanel server. One of the bset things about RKHunter is that you can configure it to do daily scans so, that you can ensure that if any rootkits are discovered they aren’t able to affect your VPS too much.
Follow the below steps to install RKHunter on VPS:-
1) wget http://downloads.sourceforge.net/rkhunter/rkhunter-1.3.2.tar.gz
tar -xzf rkhunter-1.3.2.tar.gz
cd rkhunter-1.3.2
./installer.sh
2) After you install RKHunter on VPS you can schedule it to do daily scans and to update itself on a regular basis. Configure RKHunter to schedule it to do a daily scan Please follow the below steps:-
a) vi /etc/cron.daily/rkhunter.sh (press ’shift + I’ to make the file editable)
b) (/usr/local/bin/rkhunter –update && /usr/local/bin/rkhunter -c –cronjob 2>&1 | mail -s “RKhunter Scan Details” email@domain.com) - (replace email@domain.com with your own email address)
c) press ‘esc’ and then type ‘:wq’, and your file will be saved
d) chmod 700 /etc/cron.daily/rkhunter.sh
Once this RKHunter is configured on your VPS to run a daily scan, then you will receive an automated emails as well as scripts will also check for latest updates.
Plesk 9.0.0 Requirements
Posted on March 4, 2009
Filed Under Linux Hosting, VPS hosting | Leave a Comment
To install Plesk 9.0.0 on your Linux VPS you will require any one of the OS given below:-
* Dropped! RedHat Enterprise Linux 3
* RedHat Enterprise Linux 4
* RedHat Enterprise Linux 5
* CentOS 4
* CentOS 5
* Fedora Core 4
* Fedora Core 5
* Fedora Core 6
* Fedora 7
* Fedora 8
* openSUSE 9.3
* openSUSE 10.0
* openSUSE 10.1
* openSUSE 10.2
* openSUSE 10.3
* New!openSUSE 11
* SUSE Linux Enterprise Server 9
* SUSE Linux Enterprise Server 10
How to Access Webmails
Posted on March 3, 2009
Filed Under Linux Hosting, Web-hosting, Windows VPS | Leave a Comment
In this article I will explain you how to login directly into Squirrelmail/Horde of any account by using “webmail.yourdomain.com”
Before starting with webmail you will have to create a subdomain that should be redirected to your preferred Webmail client that is Squirrelmail/Horde. By following the below steps you can easily create subdomain through Cpanel:-
1) First login into your Cpanel.
2) Now, just select the sub-domain option, and create the subdomain. Example: webmail.yourdomain.com.
3) Once it is done click on File Manager option of Cpanel.
4) By selecting the folder image beside the text “public_html” change the path to “public_html”
5) Change the path to folder that was created by your subdomain. For example it would be the “webmail” folder.
6) After you change the path inside this directory to webmail you will see “.htaccess” file however, if you are unable to see then you will have to create it manually.
Steps to create .htaccess file are as follows:-
a) Create .htaccess by selecting the “Create New File” option from Cpanel.
b) In the top right corner of the File Manager interface. Choose “Text Document” and name it “.htaccess”.
c) Refresh the File Manager and you will see that [.htaccess] in the listing of that directory.
10) Now click on the text title for the .htaccess file on the left side of the screen and a menu appears in the top right of the screen.
11) Choose the “Edit File” option, a new window opens and add the following lines there:
How to redirect “webmail.yourdomain.com” to the Squirrel Mail Client?
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
RewriteRule ^(.*)$ http://yourdomain.com:2095/3rdparty/squirrelmail/index.php$1 [R=301,L]
How to redirect “webmail.yourdomain.com”to the Horde Webmail Client?
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
RewriteRule ^(.*)$ http://yourdomain.com:2095/horde/$1 [R=301,L]
Start, Stop and restart Tomcat on VPS
Posted on March 2, 2009
Filed Under Linux Hosting, VPS Web hosting service | Leave a Comment
Installing Tomcat on VPS will not enable tomcat service through which users can stop and restart tomcat using command service tomcat restart. To enable this service you will have to create a new file in /etc/init.d as tomcat and also you have to copy the following contents into it which are given below:-
#vi /etc/init.d/tomcat
#!/bin/bash
#
# Startup script for Tomcat
#
# chkconfig: 345 84 16
# description: Tomcat jakarta JSP server
#Necessary environment variables
export CATALINA_HOME=”/usr/local/tomcat”
if [ ! -f $CATALINA_HOME/bin/catalina.sh ]
then
echo “Tomcat not available…”
exit
fi
start() {
echo -n -e ‘\E[0;0m'"\033[1;32mStarting Tomcat: \033[0m \n"
su -l tomcat -c $CATALINA_HOME/bin/startup.sh
echo
touch /var/lock/subsys/tomcatd
sleep 3
}
stop() {
echo -n -e '\E[0;0m'"\033[1;31mShutting down Tomcat: \033[m \n"
su -l tomcat -c $CATALINA_HOME/bin/shutdown.sh
rm -f /var/lock/subsys/tomcatd
echo
}
status() {
ps ax --width=1000 | grep "[o]rg.apache.catalina.startup.Bootstrap start” | awk ‘{printf $1 ” “}’ | wc | awk ‘{print $2}’ > /tmp/tomcat_process_count.txt
read line < /tmp/tomcat_process_count.txt
if [ $line -gt 0 ]; then
echo -n “tomcatd ( pid ”
ps ax –width=1000 | grep “[o]rg.apache.catalina.startup.Bootstrap start” | awk ‘{printf $1 ” “}’
echo -n “) is running…”
echo
else
echo “Tomcat is stopped”
fi
}
case “$1? in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
status)
status
;;
*)
echo “Usage: tomcatd {start|stop|restart|status}”
exit 1
esac
Once you run the above commands save and exit from the file and now assign permissions to files that you have created
#chown 755 /etc/init.d/tomcat
Enable it for all the Run-levels
#chkconfig –add tomcat
#chkconfig tomcat on
After the permissions are set you can Start, Stop and restart Tomcat on VPS by using the following commands given below:-

#service tomcat restart <<< To restart tomcat
#service tomcat stop <<< To stop Tomcat
#service tomcat start <<< To start Tomcat
#service tomcat Status <<< to check the status of Tomcat
Plesk:: Login Failed (Unable to login to Horde Webmail)
Posted on March 1, 2009
Filed Under Linux Hosting, Web-hosting, Windows VPS | 1 Comment
While Login into Horde Webmail gives :Login failed error then follow the below steps to fix this problem:-
1) By command line using telnet please check if you are able to connect to localhost:143 from the command line using telnet and if you get the error as below:
# telnet localhost 143
localhost/143: Name or service not known
2) Then you will need to check /etc/hosts file. Permissions should be -rw-r–r– and contain the record for localhost in the following format:
-=-=-
127.0.0.1 localhost localhost.localdomain
-=-=-
the above content is from From Parallels Knowledgebase
If /var/log/psa-horde/psa-horde.log shows :
FAILED LOGIN xx.xx.xx.xx to localhost:143[imap/notls] as me@mydomain.co.uk
FAILED LOGIN xx.xx.xx.xx to localhost:143[imap/notls] as me@mydomain.co.uk
I am unable to fix this issue so, I just re-installed the IMAP Service on the VPS. By following the below steps you can re-installed the IMAP Server:
-=-=-
a) The RPMS used by Plesk can be easily found in /root/psa/PSA_version directory OR you can also download the Tar containing RPMS from Parallels website http://www.parallels.com/en/download/
b) Now go to the RPM directory which contains courier Imap RPM’s
#cd [path to the PSA RPM Directory]/dist-rpm-CentOS-4.2-i386/base/
c) Re-install courier-imap-3.0.8-cos4.build81070322.16.i586.rpm and psa-courier-imap-add-8.1.1-cos4.build81070322.16.i586.rpm Once it is done services will be automatically will restarted
[root@vps base]# pwd
/root/plesk/dist-rpm-CentOS-4.2-i386/base
[root@vps base]# rpm -Uvh courier-imap-3.0.8-cos4.build81070322.16.i586.rpm psa-courier-imap-add-8.1.1-cos4.build81070322.16.i586.rpm –force
Preparing… ########################################### [100%]
Reloading configuration: [ OK ]
1:courier-imap ########################################### [ 50%]
Stopping Courier-IMAP server:
Stopping imap [ OK ]
Stopping imap-ssl [ OK ]
Stopping pop3 [ OK ]
Stopping pop3-ssl [ OK ]Starting Courier-IMAP server:
Starting imapd [ OK ]
Starting imap-ssl [ OK ]
Starting pop3 [ OK ]
Starting pop3-ssl [ OK ]2:psa-courier-imap-add ########################################### [100%]
Stopping Courier-IMAP server:
Stopping imap [ OK ]
Stopping imap-ssl [ OK ]
Stopping pop3 [ OK ]
Stopping pop3-ssl [ OK ]Starting Courier-IMAP server:
Starting imapd [ OK ]
Starting imap-ssl [ OK ]
Starting pop3 [ OK ]
Starting pop3-ssl [ OK ][root@vps base]# netstat -nap | grep :143
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1657/couriertcpd
[root@vps base]# telnet localhost 143
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
-=-=-
Once you successfully re-installed the IMAP Service on the VPs, you can login into Horde Webmail.
File transfer process through VPS
Posted on February 27, 2009
Filed Under Linux Hosting, VPS Web hosting service, VPS hosting, Windows VPS | Leave a Comment
It is one of the most basic thing you will need to perform is to transfer all your files from your VPS to your local machine or from local machine to VPS. To do this task there are many programs that you can use to copy your files between your local computer and your VPS. Some of these programs are given below:-
iManager - It allows user to use their own Web browser to upload/download files to and from VPS.
FTP - FTP stands for File Transfer Protocol. It is the most popular method for copying files between different computers. There are various FTP client programs available that you can use to copy files between your local computer and your VPS.
SMB File Sharing - SMB allows you to connect to remote computers and manage files as if they were on your local system.














