Author Archive

How to set E-mail size in exim?

You can set the E-mail size limit from your WHM.

First login into WHM
Second select “Exim Configuration Editor”  present unde ” Service Configuration” section.
Third scroll down and  click on  “Advanced Editor” optoin.

You will see  the empty box (remember select first empty box) where you can type  (right underneath where you see #!!# cPanel Exim 4 Config), enter in the following:

message_size_limit = 100M

Fourth scroll down to the bottom of that screen and click “Save” option.

Exim configuration will be rebuilt with the new option and your Exim will be restarted.

_user_password_dynamic_validation() error while installing Drupal 6.15

I have faced a big problem while installing Drupal. I am receiving following error message

[Sun Feb 28 10:00:20 2010] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function _user_password_dynamic_validation() in /usr/share/drupal/install.php on line 710, referer: http://localhost/drupal/install.php?
profile=default&localize=true

To resolve above issue we need to manually update the table values

From shell run following commands.
root@theperfectarts.com[~]#mysql -u USER -p
Enter your  mysql user password password
Or you can also

root@theperfectarts.com[~]#mysql
root@theperfectarts.com[~]#use drupal_databasename

Then run following sql statement

root@theperfectarts.com[~]#UPDATE system SET status = 1 WHERE name = ‘block’ OR name = ‘user’ OR name = ‘node’ OR name = ‘filter’;

Now try to install drupal :)

How to check mysql servers set values?

Most of the time we need to check the mysql value set on server and most of the techs checks /etc/my.cnf file.If you want to check all values set in mysql on server. We can use following simple command.

mysqld –no-defaults –verbose –help

Horde session issue?

There is a very common  issue where Horde prevents access to webmail by repeatedly redirecting viewers to Language Selection screen. The following commands, executed as root, will solve these issues:

root@server[~]#/usr/local/cpanel/bin/checkperlmodules
root@server[~]#/scripts/fullhordereset
root@server[~]#myisamchk -r /var/lib/mysql/horde/horde_sessionhandler.MYI

If still you have problem then check the ownership for session directory present in /var/cpanel/userhomes/cpanelhorde directory.

root@server[~]#ll /var/cpanel/userhomes/cpanelhorde

drwx–x–x 4 cpanelhorde cpanelhorde 4096 Jun  5  2009 ./
drwx–x–x 7 root        root        4096 Dec 17 01:48 ../
drwxr-x— 2 cpanelhorde cpanelhorde 4096 Jun  5  2009 mail/
drwx—— 2 cpanelhorde cpanelhorde 4096 Jan 27 14:01 sessions/

Session directory should be cpanelhorde.cpanelhorde ownership recursively


How to define iptables rules save option?

iptables creating rules after restarting the iptables. When iptables service is restarted settings from /etc/sysconfig/iptables file are applied and used with the iptables.

You can either set up iptables rule so that current stat is saved the rule upon restart or stop/start:

You need to make changes in following file as per your requirement for values received in following GREP result.

root@server[~]# grep IPTABLES_SAVE /etc/sysconfig/iptables-config
IPTABLES_SAVE_ON_STOP=”no”
IPTABLES_SAVE_ON_RESTART=”no”
IPTABLES_SAVE_COUNTER=”no”

Or overwrite current settings with iptables-save to /etc/sysconfig/iptables file:

root@server[~]# iptables-save > /etc/sysconfig/iptables

Note : Its always good if we use NO option for following options because some time due to wrong rule we face major problem to access server.

IPTABLES_SAVE_ON_STOP=”no”
IPTABLES_SAVE_ON_RESTART=”no”
IPTABLES_SAVE_COUNTER=”no”


Simple steps for SSH Server Hardening.

SSH Server Hardening in one of the security part to secure your server.Refer following steps to secure SSH.

root@serevr[~]#pico /etc/ssh/sshd_config

Uncomment  #Protocol 2, 1

Change to Protocol 2

Append these lines to the bottom:

LoginGraceTime 120
IgnoreRhosts yes
X11Forwarding no
Save file and restart the SSH service.

root@serevr[~]#/etc/rc.d/init.d/sshd restart

Note : SSH Protocol one  based servers are facing many automated root kits attacks.As a result to step up the security Protcol 2 should be enabled on server.The reason to use SSH Protocol 2 on any webserver is that it is more secure as compare to protocol 1.

/scripts/fixquotas gives error “edquota: Quota file not found or has wrong format”?

After running /scripts/fixquotas it gives following error message and showing unlimited disk space in WHM >> Main >> List account.

root@server [/]# /scripts/fixquotas –force
Installing Default Quota Databases……Done
Linux Quota Support
Quotas are now on
Resetting quota for user23 to 1000 M
edquota: Quota file not found or has wrong format.
No filesystems with quota detected.
edquota: Quota file not found or has wrong format.
No filesystems with quota detected.
Resetting quota for user2 to 1000 M
edquota: Quota file not found or has wrong format.
No filesystems with quota detected.
Resetting quota for dates to 1000 M
Resetting quota for userq to 1000 M
edquota: Quota file not found or has wrong format.

In this case refer following steps.

root@server [/]#touch /home/quota.user
root@server [/]#touch /home/quota.group
root@server [/]#chmod 600 /home/quota.user
root@server [/]#chmod 600 /home/quota.group

root@server [/]#quotacheck -acugv

Some time above command gives error message

root@server [/]# quotacheck -acugv
quotacheck: Cannot remount filesystem mounted on / read-only so counted values might not be right.
Please stop all programs writing to filesystem or use -m flag to force checking.

Than run following command

root@server [/]# quotacheck -acugvm
quotacheck: Scanning /dev/simfs [/] quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
done
quotacheck: Checked 33478 directories and 368211 files
quotacheck: Old file not found.
quotacheck: Old file not found.

Now run

root@server [/]#/scripts/fixquotas –force

It will sort out your issue ENJOY :)

How to install Webmin?

You can install webmin by using following steps.

root@gunjan[~]#cd /usr/local/src

root@gunjan[~]#wget http://sourceforge.net/projects/webadmin/files/webmin/1.500/webmin-1.500-1.noarch.rpm/download

root@gunjan[~]#rpm -Uvh webmin-1.500-1.noarch.rpm

warning: webmin-1.500-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID xxxxx
Preparing… ########################################### [100%]
Operating system is CentOS Linux
1:webmin ########################################### [100%]
Webmin install complete. You can now login to http://server.domain.com:10000/
as root with your root password.

How to install YUM on plain Server?

First you need to login into shell as root user than follow the steps one by one.

[root@gunjan]#mkdir /root/support  && cd /root/support

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/gmp-4.1.4-10.el5.i386.rpm

[root@gunjan]#rpm -Uvh gmp-4.1.4-10.el5.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/readline-5.1-3.el5.i386.rpm

[root@gunjan]#rpm -Uvh readline-5.1-3.el5.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-2.4.3-27.el5.i386.rpm

[root@gunjan]#rpm -Uvh python-2.4.3-27.el5.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/libxml2-2.6.26-2.1.2.8.i386.rpm

[root@gunjan]#rpm -Uvh libxml2-2.6.26-2.1.2.8.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/libxml2-python-2.6.26-2.1.2.8.i386.rpm

[root@gunjan]#rpm -Uvh libxml2-python-2.6.26-2.1.2.8.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/expat-1.95.8-8.2.1.i386.rpm

[root@gunjan]#rpm -Uvh expat-1.95.8-8.2.1.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm

[root@gunjan]#rpm -Uvh python-elementtree-1.2.6-5.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/sqlite-3.3.6-5.i386.rpm

[root@gunjan]#rpm -Uvh sqlite-3.3.6-5.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm

[root@gunjan]#rpm -Uvh python-sqlite-1.1.7-1.2.1.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/elfutils-0.137-3.el5.i386.rpm

[root@gunjan]#rpm -Uvh elfutils-0.137-3.el5.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/rpm-python-4.4.2.3-18.el5.i386.rpm

[root@gunjan]#rpm -Uvh rpm-python-4.4.2.3-18.el5.i386.rpm

[root@gunjan]#It will throw following error.

[root@gunjan]# rpm -Uvh rpm-python-4.4.2.3-18.el5.i386.rpm

warning: rpm-python-4.4.2.3-18.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
popt = 1.10.2.3-18.el5 is needed by rpm-python-4.4.2.3-18.el5.i386
rpm = 4.4.2.3-18.el5 is needed by rpm-python-4.4.2.3-18.el5.i386
rpm-libs = 4.4.2.3-18.el5 is needed by rpm-python-4.4.2.3-18.el5.i386

In that case search dependencies in following URL

http://rpm.pbone.net/

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/m2crypto-0.16-6.el5.6.i386.rpm

[root@gunjan]#rpm -Uvh m2crypto-0.16-6.el5.6.i386.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm

[root@gunjan]#rpm -Uvh python-urlgrabber-3.1.0-5.el5.noarch.rpm

[root@gunjan]#wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-3.2.22-20.el5.centos.noarch.rpm

[root@gunjan]#rpm -Uvh yum-3.2.22-20.el5.centos.noarch.rpm

It will throw following error.

[root@gunjan]# rpm -Uvh yum-3.2.22-20.el5.centos.noarch.rpm
warning: yum-3.2.22-20.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
python-iniparse is needed by yum-3.2.22-20.el5.centos.noarch
rpm-python is needed by yum-3.2.22-20.el5.centos.noarch
yum-fastestmirror is needed by yum-3.2.22-20.el5.centos.noarch
yum-metadata-parser >= 1.1.0 is needed by yum-3.2.22-20.el5.centos.noarch

In that case search dependencies in following URL

http://rpm.pbone.net/

Once you complete all dependencies you can update yum by using following command

[root@gunjan]#yum -y update