Archive for April, 2008



Some exim commands for cPanel server

Monday, April 28th, 2008

Here are some exim commands which may help system administrators.

To check how many emails are in the exim mail queue the command is:

exim –bpc

Check frozen emails in the mail queue by the command:

exim –bp | grep frozen

Number of frozen emails in the mail queue:

exim –bp | grep frozen | wc –l

Delete frozen emails from the exim mail queue:

exim -bp | awk ‘$6 == “frozen” {print $3}’ | xargs exim –Mrm

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Log files on a cPanel dedicated server

Friday, April 25th, 2008

Log file is a file which stores all the information of all files that are accessed, and they also have errors which help a system administrator to troubleshoot issues and fixing them to make the web server stable. Few logs can be found below:

Apache web server

/usr/local/apache/logs/access_log
/usr/local/apache/logs/error_log
/usr/local/apache/domlogs/domain.com

MySQL database server

/var/lib/mysql/server.hostname.com.err

Exim mail server

/var/log/exim_mainlog
/var/log/exim_paniclog
/var/log/exim_rejectlog

Courier-IMAP

/var/log/maillog

cPanel control panel

/usr/local/cpanel/logs/error_log
/usr/local/cpanel/logs/access_log
/usr/local/cpanel/logs/license_log
/usr/local/cpanel/logs/login_log
/usr/local/cpanel/logs/stats_log

FTP server

/var/log/messages
/var/log/xferlog

System logs

/var/log/messages
/var/log/boot.log
/var/log/cron
/var/log/dmesg

Security logs

/var/log/secure
/var/log/messages

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


CPanel stats lastrun not updated

Wednesday, April 23rd, 2008

On a cPanel dedicated web server, while monitoring the stats I have come across the error where it was showing that /var/cpanel/lastrun was last updated 841266 seconds ago.

To fix this I have executed the script, this may take some time – so check after an hour.

/scripts/runstatsonce

That’s it!

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Disable PHP error_reporting

Tuesday, April 22nd, 2008

You must have come across PHP errors like NOTICE , WARNINGS etc… and you need to disable this so this is not shown in your PHP page. To do so you can add a simple code within your PHP file. The code is:

error_reporting(0);

That’s it!

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Change open_basedir for a domain on a linux plesk server

Monday, April 21st, 2008

In plesk if you need to set open_basedir to none, for this do the following:

nano /var/www/vhosts/yourdomain.com/conf/vhost.conf

add the following code in vhost.conf

<Directory /var/www/vhosts/yourdomain.com/httpdocs>
php_admin_flag engine on

php_admin_value open_basedir none
</Directory>

Now, you will have to reconfigure plesk for this domain – by the following command:

/usr/local/psa/admin/sbin/websrvmng -u —vhost-name=yourdomain.com

Then restart apache. That’s it!

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Find files having permissions 644 in Linux

Sunday, April 20th, 2008

If you want to find files having permissions 644 under any particular directory, the find command will help to achieve this. For example you have 1000 files under on your cPanel dedicated server under a user called “support”.

Use the following commands:

root@server# cd /home/support/public_html

root@server# find . -type f -perm 644

I hope you see all the files having the permissions 644 now.

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Downgrade MySQL 5 to MySQL 4.1 on cPanel dedicated server

Friday, April 18th, 2008

For some reason you need to downgrade MySQL 5 to MySQL 4.1 to achieve this you will have to do the following:

To check the which all mysql rpm’s are available use the command:

rpm -qa | grep -i mysql-

First of all take a backup of /var/lib/mysql, and also ask the other users to keep a backup it with them. This can also be a .sql file. The command to take a backup is:

cp /var/lib/mysql /var/lib/mysql.bk

Now, you will have to edit the cPanel config file and make manual changes under this, so edit it with the command:

nano /var/cpanel/cpanel.config

And here, find for the line “mysql-version=5.0” and change it to “mysql-version=4.1

Now, we will forcefully install mysql by the following command:

/scripts/mysqlup --force

You can now check again with the command:

rpm -qa | grep -i mysql-

This is done and worked for me.

Let us know if this has helped you and have any suggestions on this.

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


How to install nmap on CentOS

Thursday, April 17th, 2008

nmap (Network Mapper) is a free and open source utility. Here, we will use it to see the ports open on your cPanel server are. To install nmap on your cPanel server, use the following command:

yum install nmap

This will install nmap on your server, to check it use the command:

nmap localhost

That’s it!

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Disable wget on a cPanel web server

Saturday, April 12th, 2008

wget retrieves files from the web. “wget” is a network utility to retrieve files from the Web using http, https and ftp, this are the most widely used TCP/IP based protocols.

It is recommended that “wget” should allow only “root” to use this, and no other users which are present on your cPanel server. To disable this do the following:

Login in SSH as root.

First, take a backup of “wget” by the command:

cp /usr/bin/wget /usr/bin/wget-bk

Now, execute the following command:

chmod 700 /usr/bin/wget

If you have fantastico installed on your cPanel server, it may have problems as fantastico uses wget to retrieve files, to overcome this problem you have to add the backup file of wget i.e; /usr/bin/wget-bk in fantastico configuration file.

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


“Disable spamassassin” button not seen in cPanel

Friday, April 11th, 2008

In your cPanel, spamassassin is enabled and you are unable to see the “Disable spamassassin” button in your cPanel. If you need this button visible under your cPanel do the following:

Login as root in your WHM.

Here, on the left pane you will see an option “Exim configuration editor” click on that. Now, scroll down and you will see the option:

SpamAssassinTM: Enable for all users without the option for users to shut off per account” under the heading “SpamAssassinTM Options” – uncheck the checkbox and save.

Now, relogin to your cPanel account and check for spamassassin – you will find the button “Disable spamassassin

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.