Thursday, February 28, 2013

Find roundcube version provided by the cPanel and upgrade

How to find roundcube version provided by the cPanel?
The roundcube version provided by the cPanel is 0.5.4.
===
-bash-3.2# cat /var/cpanel/roundcube/version
0.5.4.cp11130.1-bash-3.2#
===
cPanel dicument regarding the roundcube
====
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/RoundcubeReadme
====
Upgrade rouncube version
/usr/local/cpanel/bin/update-roundcube –force
cd /usr/local/cpanel/base/3rdparty/
mv roundcube roundcube-backup
wget http://softlayer.dl.sourceforge.net/project/roundcubemail/roundcubemail/0.6/roundcubemail-0.6.tar.gz
tar -zxf roundcubemail-0.6.tar.gz
mv roundcubemail-0.6 roundcube
cp roundcube-backup/config/main.inc.php roundcube/config/
cp roundcube-backup/config/db.inc.php roundcube/config/
chown root:wheel -R roundcube
cd roundcube/config
chown cpanelroundcube:cpanelroundcube db.inc.php
chown cpanelroundcube:cpanelroundcube main.inc.php
echo > /var/cpanel/roundcube/install
chmod +x /var/cpanel/roundcube/install

How to change node name in solusvm

To change the node in solusvm, you can use the following script

php /usr/local/solusvm/scripts/node.php --type=force --comm=name --nodeid=nodeid in solusvm --name=new-name

eg:- php /usr/local/solusvm/scripts/node.php --type=force --comm=name --nodeid=4 --name=jibin

Wednesday, February 27, 2013

Netmask CIDR conversion

Netmask Binary CIDR Notes

255.255.255.255 11111111.11111111.11111111.11111111 /32 1 useable
255.255.255.254 11111111.11111111.11111111.11111110 /31 0 useable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable

255.255.255.0 11111111.11111111.11111111.00000000 /24 class C

255.255.254.0 11111111.11111111.11111110.00000000 /23
255.255.252.0 11111111.11111111.11111100.00000000 /22
255.255.248.0 11111111.11111111.11111000.00000000 /21
255.255.240.0 11111111.11111111.11110000.00000000 /20
255.255.224.0 11111111.11111111.11100000.00000000 /19
255.255.192.0 11111111.11111111.11000000.00000000 /18
255.255.128.0 11111111.11111111.10000000.00000000 /17
255.255.0.0 11111111.11111111.00000000.00000000 /16 class B

255.254.0.0 11111111.11111110.00000000.00000000 /15
255.252.0.0 11111111.11111100.00000000.00000000 /14
255.248.0.0 11111111.11111000.00000000.00000000 /13
255.240.0.0 11111111.11110000.00000000.00000000 /12
255.224.0.0 11111111.11100000.00000000.00000000 /11
255.192.0.0 11111111.11000000.00000000.00000000 /10
255.128.0.0 11111111.10000000.00000000.00000000 /9
255.0.0.0 11111111.00000000.00000000.00000000 /8 class A

254.0.0.0 11111110.00000000.00000000.00000000 /7
252.0.0.0 11111100.00000000.00000000.00000000 /6
248.0.0.0 11111000.00000000.00000000.00000000 /5
240.0.0.0 11110000.00000000.00000000.00000000 /4
224.0.0.0 11100000.00000000.00000000.00000000 /3
192.0.0.0 11000000.00000000.00000000.00000000 /2
128.0.0.0 10000000.00000000.00000000.00000000 /1
0.0.0.0 00000000.00000000.00000000.00000000 /0

Steps to repair and recover innodb db if corrupted

Follow below step by step procedure to repair and recover innodb db if corrupted

********************************************************
I)Add this line to your /etc/my.cnf configuration file:
[mysqld]
innodb_force_recovery = 4

II)Restart Mysql now. Database should start, but with innodb_force_recovery in my.cnf all Insert and Update operation will be ignored.

III)Mysqldump all databases.
#mysqldump -A > dump.sql

NOTE: It is better to take dump of individual dbs

if the dump fails create a copy of current /var/lib/mysql directory
#cp -pr /var/lib/mysql /var/lib/mysql_bak

IV)Shutdown database and delete the data directory (better if you move it) and execute mysql_install_db from shell to create MySQL default tables.
#mysql_install_db

V)Remove the "innodb_force_recovery" line from your /etc/my.cnf file and restart the database.

VI)Restore everything from your backup except default 'mysql' database. For restoring the prvious user db privileges do the following.
#cp -rp /var/lib/mysql_bak/mysql /var/lib/mysql/oldmsqldb
#mysqldump oldmysqldb user > oldmysqldb_user.sql
#mysql mysql user < /var/lib/mysql/oldmysqldb_user.sql ********************************************************** Ref: http://www.softwareprojects.com/resources/programming/t-how-to-fix-mysql-database-myisam-innodb-1634.html http://webscholar.net/2010/11/07/repair-innodb-corruption-on-cpanel-mysql-server/

Exim control parameters

We can delay or suspend the email delivery process in exim if the load is high. 3 parameters determine this
---

queue_only_load


If the system load is higher than the value of queue_only_load, automatic delivery of incoming messages does not occur; instead, they wait on Exim's queue until the next queue runner proces

deliver_load_max


no deliveries at all are done if the load is higher that this setting

deliver_queue_load_max


Deliveries from queue are done if the load is lower that this setting
----

These three options are not fully independent. For example

deliver_queue_load_max = 14
deliver_load_max = 10

This would allow deliveries only from queue runs when the load was between 10 and 14.

I have set following values for paola server
---
deliver_queue_load_max = 30
queue_only_load = 8
----

Effect of this is when load is 8, one email is delivered at a time and no emails are delivered above 30. Please tweak these values if client complains

Add server in cacti

You can use the following steps to add server in cacti
get into the cacti admin panel

1. Click Console Tab (Left corner)
2. Click Create >> Devices
3. Click Add (Right corner)
4. Configuration
a. Description = Hostname of server
b. Hostname = IP of server
c. Host Template = Gemeric SNMP enabled host
d. Ping Timeout = 500
e. Ping Retry = 2
f. SNMP version = Version 2
g. SNMP Community = community name
h. Click Create
5. Console > New Graphs
a. Host = select newly created host
b. Create = Interface - Traffic
c. Select the correct interface
d. Select a graph type: in/Out Bits (64 bit counters)
d. Click Create
6. Console > Graph Trees
a. Select polo >> group name (add)
b. Tree Items > Add (right corner)
c. Tree Item Type = Host
d. Host = select newly created host
e. Click Create

How to change ssh port

To change the ssh port, edit the file /etc/ssh/sshd_config
Then change the value port 22 to desired value
next enable that port in csf configuration
You are done!

Monday, February 18, 2013

Crontab Missing from server

If you found crontab was not present in your server, you can go
for the following steps to install the same

yum -y install vixie-cron.x86_64
OR
yum -y install vixie-cron
/etc/init.d/crond start
chkconfig crond on

Net::Smtp Installation

It is a perl module and we can install it via cpan promt
cpan> install Net::SNMP

You are done!
To exclude a directory from find command

find / ./dirname -name filename

This will exclude the dir "dirname" from the search