Archive for May, 2008



Hosting account migration manually on cPanel server

Monday, May 26th, 2008

There is a scenario where you need to transfer a hosting account which is present on your server to another (new) server, to accomplish this follow the below steps:

Present server:

cd /home

/scripts/pkgacct username
This command will create a file cpmove-username.tar.gz in the /home directory, now this is to be copied to the new server.

scp cpmove-username.tar.gz root@server-IP:/home
This will prompt for the password, you can enter the new server password.

New server:

/scripts/restorepkg username
This will restore the hosting account which includes email, database and the contents

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 exec PHP function on cPanel server

Monday, May 26th, 2008

On a cPanel server there is always security risk of PHP functions for eg. exec if you want to disable this function on your cPanel server you can do so from your servers php.ini

You can find the php.ini of your server by the following command:

root@server# php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

Then, edit that file and search for disable_functions and add the function exec in front of that.

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


Spamd failed on cPanel

Saturday, May 24th, 2008

You have a cPanel server and if you’re receiving messages like below, in your emails and you do not need this messages in your inbox.

spamd failed @ Fri May 23 20:32:36 2008. A restart was attempted automagically.

Within your WHM > Security > Service manager there are two checkboxes one is “enabled” and other is “monitor” just uncheck the monitor one and you will not receive any more notification emails in your inbox.

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 command in linux

Saturday, May 24th, 2008

Find is a wonderful command that is used in day to day. Some useful commands on find are as follows:

- To search the system for files that were modified within the last three days:

root@server# find / -mtime -3 -print

- List all files named core in the directory /test

root@server# find /test -name core

- To search the current directory and subdirectories for files beginning with name “conf” and prints the path:

root@server# find . -type f -name ‘conf*’ -print

To search in the current directory and all sub directories all files that contain the string “test” and will have their path printed to standard output.

root@server# find . -exec grep -q “test” ‘{}’ \; -print

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


Apache error on a plesk server

Saturday, May 24th, 2008

On a plesk server got the below apache error in the error logs:

Address already in use: make_sock: could not bind to address [::]:443 no listening sockets available, shutting down

First we will find which process is using the port, the command is:

root@server# /usr/sbin/lsof -i | grep http

Once you get the PID of the process kill that PID and restart apache server.

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


Error from park wrapper: domain.com is already configured

Thursday, May 22nd, 2008

On a cPanel server if you get the error: Error from park wrapper: domain.com is already configured while adding an add-on domain under cPanel. Make sure to remove the domain.com entries from:

/var/named/domain.com.db
/etc/httpd/conf/httpd.conf
/var/cpanel/users/username
/etc/userdomains
/etc/localdomains

Renaming or commenting will not help; you will have to remove the entries completely. Try now.

This worked for me.

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


Check server load on Linux

Wednesday, May 21st, 2008

There are commands to check load on the server, commands that are used regularly are:

root@server [/]# uptime
13:22:16 up 97 days, 14:02, 1 user, load average: 0.00, 0.01, 0.00

The uptime command displays current time, uptime from when it was last booted, number of user sessions and load averages. The load average is number of processes which were active from past one minute, five minutes and, fifteen minutes.

The information provided by “uptime” command is the same as that provided in the first line of output by the “w” command.

The widely used command to check load is the “top” command. The “top” command will display the load as well as CPU time with the memory usage. It will give you the list of processes, you can also check the memory usage by hitting the “m” in the middle. If you want to kill a particular PID you can hit “k” and type the PID and hit enter. This will kill that particular PID.

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


PHP fatal error: session_start()

Tuesday, May 20th, 2008

For some reason for a PHP script if you get such error:

“Fatal error: session_start()”

Or

“Warning: session_start() [function.session-start]“

Add this line in your .htaccess file:

php_value session.save_path /tmp

And try now, make sure that the session path in your program is /tmp if it is something other you can set it to your session path – this worked for me.

Best of luck!

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


PHP directives and php.ini path on cPanel hosting server

Monday, May 19th, 2008

php.ini is a configuration file that is read when a php script gets executed, when the php script starts it looks for it in the current working directory, if it’s not present then it will check for the main servers php.ini . It contains the directives with their local values and master values – few most common directives are: register_globals, allow_url_include , allow_url_fopen , open_basedir etc…

So, you must be wondering how to find the path for php.ini on your cPanel web server. Assuming that you have root access the command to check the path is:

root@server# php –i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib/php.ini

If you’re not a system admin and you do not have root access, but want to know about the PHP directives which is on the server on which your site is hosted – this can be done by creating a simple PHP file and accessing it with your favorite browser. Just add the below code in the PHP file:

<?
phpinfo();
?>

I hope you see all the information that you require.

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


Manage www with .htaccess

Saturday, May 17th, 2008

For your domain if you require www you can achieve this by adding the following code in your .htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ /$1 [R=301,L]

Now, what if you don’t require www, add this code in your .htaccess:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

Try 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.