cPanel

WARNING: LastLine parameter in history file is so in future. May be you need to correct manually the line LastLine in some awstats*

This warning is erroneously generated because of the difference between GMT and your server local time. Just comment out the line generating the warning in awstats.pl.

Go to

/usr/local/cpanel/3rdparty/bin/awstats.pl

and search for this particular line in it and comment it with a # like below

# Warning if lastline in future
if ( $LastLine > ( $nowtime + 20000 ) ) {
warning(
#”WARNING: LastLine parameter in history file is ‘$LastLine’ so in future. May be you need to correct manually the line LastLine in some awstats*.$SiteConfig.conf files.”
);
}

Standard
cPanel, OpenVz

mod_fcgid: error reading data from FastCGI server

If the website intermittently give 500 error and if you are seeing the below error on the logs.

===

[Fri Aug 29 09:08:06.123262 2014] [fcgid:warn] [pid 31144:tid 140133779031808] (104)Connection reset by peer: [client 208.xx.xx.xx:51433] mod_fcgid: error reading data from FastCGI server, referer: http://www.xxxl.com/classifieds.php [Fri Aug 29 09:08:06.123312 2014] [core:error] [pid 31144:tid 140133779031808] [client 208.xx.xx.xx :51433] End of script output before headers: sample.php, referer: http://www.xxx1com/classifieds.php

===

UserDir requests will not function correctly when using Mod_FCGI. This is documented at:

https://documentation.cpanel.net/pages/viewpage.action;jsessionid=EE900DCD2DBC1D949177B14C74346610?pageId=360752#FCGI Considerations

Disabling SuExec will allow the URL to load, but it reduces the overall security of FCGI.

Also try to increase memory parameter for the vps. You can check the current from node using :

cat /proc/beancounters

Standard
cPanel

Terminate accounts that are suspended for more than 2 months in cPanel

As a server administrator, you might want to follow-up which account has suspended for days and it’s the time for you to terminate it.

With a smart system administrator(lazy actually), you may have a custom script to check any of your account that been suspended for more than 2 months may terminate from the server automatically to save the resource/space from the server.

From this article, Mick Genie will guide you how to write a shell script and create it from the cronjob, however this step could only done by the root user.

1. Create a file name autoterminated_within60days.sh from /root/scripts/.
2. Insert the following code and save it.

for i in `find /var/cpanel/suspended/ -mtime +60 | cut -d’/’ -f5 | sed ‘1 d’`
do
y | /scripts/killacct $i;
done;

3. Create a cronjob, by typing crontab -e in SSH.
4. Type as following line in the crontab to apply daily checking.

0 0 * * * /bin/sh /root/scripts/autoterminated_within60days.sh

Standard
cPanel

Assign dedicated IP to a subdomain on cPanel

You might want to assign dedicated IP to your subdomain for some reason such as apply SSL to your subdomain.

If you are using cPanel and wish to set dedicated IP to your subdomain, you will find no else where to do that.

However, this could still be able to fix as this article.

Scenario,
– You have domain domain.com and subdomain blog.domain.com.

– You wish to set dedicated IP for blog.domain.com which originally 100.100.100.100 and result as blog.domain.com resolve to 10.0.0.1.

1. Log into SSH, go to the folder of /var/cpanel/userdata,

cd /var/cpanel/userdata
2. Select the cPanel username folder such as ashiks
cd /var/cpanel/userdata/ashiks

3. You will now see the following file,
domain.com
domain.com.cache
blog.domain.com
blog.domain.com.cache
main
main.cache

4. Open the file named blog.domain.com,
vi blog.domain.com

5. You should find the content as below,
ip: 100.100.100.100

6. Change it to detail as below,
ip: 10.0.0.1

7. Now, you have done but you will need to rebuilt the Apache,
/scripts/rebuildhttpdconf

8. Restart the Apache services,
/scripts/restartsrv_apache

Standard
cPanel

Exclude Folder/Files from cPanel backup

Did you know that cPanel actually designed to be able to disallow certain folder/files to be backed up from your cPanel backup?

To accomplished this, you may look for the configuration file name cpbackup-exclude.conf. This configuration file exists in your virtual account root folder such as /home/username/cpbackup-exclude.conf.

If this file is not exist, you may simply create it.

1
touch /home/user/cpbackup-exclude.conf
Then you may open this file and enter the desired folder/files. The file format could be as below,

1 */.wysiwygPro_*
2 */core.[0-9]
3 */core.[0-9][0-9]
4 .MirrorSearch
5 .cpan<
6 .cpanel/caches
7 .cpanel/datastore
8 .cpcpan
9 .wysiwygPro_*
10 access-logs
11 core.[0-9]
12 core.[0-9][0-9]
13 public_ftp/.ftpquota

Standard
cPanel, Mysql

Database Missing from cPanel

Check your /var/lib/mysql folder and see if you maybe have folders in there named incorrectly. On one of my servers, the admin renamed several of the databases to $dbname.bak when making changes, and when the database quota script ran it was erroring out. After you move or remove these folders, run the following commands:Before all, check whether the database exist in /var/lib/mysql

/scripts/update_db_cache

/usr/local/cpanel/bin/setupdbmap

Assuming you’ve removed all the invalid databases from the MySQL folder, you should now be able to see the ones that were previously missing.

If you are still unable to see this, go to

/var/cpanel/cpanel.config

and you can see a line like below

disk_usage_include_sqldbs=1

change the ‘1’ here to ‘0’ and then save the file and exit. Again perform the below

1) /scripts/update_db_cache

2) /usr/local/cpanel/bin/setupdbmap

Then change to ‘1’ and again do the updating steps above (1 and 2)

Still unable to see this ?Don’t worry

Go to WHM, there is a tool called Database mapping tool. Open it and it will ask for Database name and user name. Give both or if you don’t know the user name, leave that blank and click on Submit Query.Even if it shows any errors. the database will be now shown on the cPanel.

Standard
cPanel

How to Set up Multiple Shared IPs on a cPanel Server

There are some situations where you may need to set up multiple shared IP addresses on a server.  Some reasons may include grouping accounts per IP or lowering the effect of DDoS attacks if it becomes necessary to block traffic to a specific interface.  Whatever the reason, multiple shared IP addresses on a cPanel server is rather easy to set up.

 

First you’ll want to reserve the IP address via WHM -> Reserved IPs.  Alternatively, simply drop them into /etc/reservedips, separated by line, ie:

1.2.3.4

4.5.6.7

7.8.9.10

If you want to label the reserved IPs, set them up in /etc/reservedips:

1.2.3.4=shared ip

4.5.6.7=shared ip

… and so on

Now rebuild the IP pool:

/scripts/rebuildippool

This will prevent the IPs from being used as dedicated IPs for individual cPanel accounts, but for multiple accounts to be able to use them as shared IPs you’ll need to add them to a pool.  Simply use the /var/cpanel/mainips/root file to list each IP on its own line.  When root creates an account on the server, the first IP address in that file will be used.  If you want a reseller to have multiple shared IPs as well, simply replace ‘root’ with the reseller’s username.

Standard
cPanel

Internal Server Error 500:No response from subprocess (/usr/local/cpanel/base/3rdparty/installatron/index.cgi):

Internal Server Error

500

No response from subprocess (/usr/local/cpanel/base/3rdparty/installatron/index.cgi): subprocess exited with status 199

solution: do the steps below..

rm -fr /usr/local/installatron/lib /usr/local/installatron/etc/php.ini

curl -O http://dal01.installatron.com/installatron-plugin.sh

chmod 755 installatron-plugin.sh

./installatron-plugin.sh -f –edge

Standard