If you see such an error while accessing any of the WHM Plugins, it is due to the recent changes that is made to Security settings under cPanel. To fix this issue, go to WHM >> Tweak Settings >> Under Security tab turn “on” the option “Allow apps that have not registered with AppConfig to be run when logged in as root or a reseller with the “all” ACL in WHM” and that will fix it.
nixadmin
How to stop other domain name point to your IP?
I could see that some domains point their host to my IP. For example, if someone type www.other-domain.net, it redirect to my IP: 255.255.255.255 which is address of my web. Since my domain is hosted on a dedicated IP, the domain www.other-domain.net will load the content of my site.
There is absolutely nothing you can do about people pointing their DNS at your IP address because it is their DNS. One thing they can do is direct people to your website with their domain name in the URL bar. You can easily redirect visitors to the correct domain by putting this in your .htaccess file.
RewriteCond %{HTTP_HOST} !^www.my-domain.com$
RewriteRule ^/?(.*) http://www.my-domain.com/$1 [QSA,R=301,L]Also try reporting domain registered companies for abuse.
Danger behind cPanel account restore – Shared hosts..be careful!
Today I have been playing with my test cPanel server. I thought to have some look into the reseller settings today and I found a serious anomaly while my works. On now..what it is…
I know very rarely we need the “All Features (warning: total and complete access)” privilege granted for a reseller. Because that privilege will give root level access to the reseller on the server, which is not allowed. So generally no-one with a root level WHM access is not able to create a reseller with all privileges. So it is obvious that anyone with root privilege ( like VPS owners ) can create “all privilege” reseller. Now what happened when we restore such a reseller to a server? What changes does it make compared to a normal user or a reseller without any privilege? So far I couldn’t find any. I couldn’t find any specific messages or difference in restore process for a normal user, reseller without “all” privilege” or with “all” privilege. I could find the following common message only with any of them ( in fact the admins I found don’t worry about the restore messages until they find any specific error while restoration )
E: Encountered a section with no Package: header – Ubuntu / Mint Linux/ Debian
To fix this issue, try the following commands sudo rm -rf /var/lib/apt/lists/* -vf sudo apt-get update
Internal Server Error 500 Failed to create a session – cpsrvd
If you see this error while trying to login to WHM / cPanel, it can due to the file system is full and cPanel system cannot create seesions. Check the file system usage and inode using the following commands. df -i :- to check inode usage df -h :- to check disk space usage If … Read more
strict warning: Non-static method view – Drupal warning messages – Drupal / PHP 5.4
As E_STRICT is now the part of E_ALL from PHP 5.4 ( Reference http://us.php.net/ChangeLog-5.php#5.4.0 ), this warning can pop-up on most systems with Drupal + PHP 5.4 because usually E_ALL is set as the default error reporting for PHP. Also PHP 5.4 is not officially supported by Druapl. Using a supported PHP version also can resolve issues with Drupal views ( Refer https://drupal.org/requirements/php for Druapl’s PHP requirements )
Anyway we need to use PHP 5.4 for Druapl and to avoid such warnings to display in the website. Disabling E_STRICT in php.ini didn’t help, because Druapl defines its own error reporting function. So we had to make the following changes to the Druapl core files, as per the information collected from their forum.
1. Open /includes/bootstrap.inc
In the beginning of function drupal_set_message and below “if ($message) { ” line, put the following code
mysqli_connect(): (HY000/2002): Can’t connect to local MySQL server through socket – SugarCRM – cron.php
PHP Warning: mysqli_connect(): (HY000/2002): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in sugarcrm/include/database/MysqliManager.php on line We have faced such an error with SugarCRM today. The above error was reporting in error_log file every time the cron.php is executed via cron job. We have taken a closer look and couldn’t find any real reason why … Read more
Remove old backups from rdiff-backup backup point – rdiff backup remove old increments
Importance of Backups in Hosting IndustryIn the hosting industry, sudden failure of a hard disk can cause sleepless nights for server owners and can cause a bad reputation company as well. Also having proper remote backups is an added advantage to the customers as well and can attract some customers as well due to this. Rdiff-backup is one such tool which is having great features that every hosting owner will wish to have.
What is Rdiff-backup
Rdiff-backup is a powerful remote backup tool that is based on python.
Rdiff-backup backs up one directory to another possibly over the network. The target directory will have a copy of the source directory but extra reverse diffs of that directory are stored in a subdirectory which will help us to recover files from long ago. In this tool, they have combined the features of mirroring and incremental backups.
Rdiff-backup preserves subdirectories, hard links, uid/gid ownership (provided this is running as root), resource forks, modification times, permissions, etc which makes this a perfect tool for backups
In this blog, we mainly discuss only the removal of old backups.
How to remove old backups from rdiff-backup properly
To remove old backups from rdiff-backup ( so-called increments ), you can use “–remove-older-than” option of rdiff-backup command. You should have to specify the “time from which” value as well along with that switch. The rdiff-backup tool provides the flexibility to define that time_spec value in years, months, weeks, days, hours, minutes, and seconds. Each representation is given below.
To Remove backups older than one year, use the below
–remove-older-than 1Y
To Remove backups older than one month, use the below
–remove-older-than 1M
To Remove backups older than one week, use the below
–remove-older-than 1W
To Remove backups older than one hour, use the below
–remove-older-than 1h
To Remove backups older than one minute, use the below
–remove-older-than 1m
To Remove backups older than one second, use the below
–remove-older-than 1s
The entire command to remove backups ( increments ) should look like following
Premature end of script headers: wredirect.cgi
If you are getting Internal Server Error while doing /webmail /whm /cpanel , please check the apache error log.
For us it was like the below error
[Tue Oct 08 08:14:44 2013][error][client x.x.x.x] Premature end of script headers: wredirect.cgi [Tue Oct 08 08:14:44 2013][error][client x.x.x.x] File does not exist: /home/user/public_html/500.shtml
A temporary fix is to disable Suexec from WHM from the drop down at Home »Service Configuration »Configure PHP and suEXEC and save. But in this case you are compromising the security.
This is actually a known bug and if you are using cagefs then please do the below steps to fix this permanently
cagefsctl --remount-all service proxyexecd restart
Linux Shell Scripting – An Introduction
Linux Shell Scripting
Scripts are collections of commands that are stored in a file. The shell can read this file and act on the commands as if they were typed at the keyboard. The shell also provides a variety of useful programming features to make your scripts truly powerful.
Write a simple shell script
Use an editor software to write the script. The following is the simplest “Hello World” program.
#!/bin/sh # My first script echo "Hello World!"
and save the above script to the file name “myScript.sh”
We can use any name for saving the script. but here I am using “.sh” extension for my script, since the shell used here is “/bin/sh”. Also it will help us to identify the scripts from a other files and folders.