Showing posts from June, 2014

how to stop cPanel backup during the process?

The only way is to rename your backup Drive to something else and the process will be stopped.

The other way can be unmout backup drive for a short and the process stops.

Other Solutions can be:
kill the do I go to TOP, then search for the PID and then...KILL?

**kill childrent not homocide**
Yes. All you can 

ps -aux | grep pkgacct

and kill the process ID that comes up

How to disable Lfd excessive resource usage alert - Solution

LFD : is the abbreviation of Login Failure Daemon. It is a daemon process running on a server which has CSF for server security. LFD scans the server logs files periodically (every X seconds) for resent login failures and consider such attepts like “Brute Force Attacks” and block that IPs with the help of CSF. In some strange situations you may get some alert emails from server for excessive resource usage. In LFD we can set resource usage limit. You can refer here for more details onProcess tracking with the help of csf. How to disable Lfd excessive resource usage alert? Example email alert from LFD. Time: Tue Nov 25 09:15:10 2012 +0520 Account: crybit Resource: Virtual Memory Size Exceeded: 205 > 200 (MB) Executable: /usr/bin/php Command Line: /usr/bin/php /home/crybit/public_html/index.php PID: 11254 (Parent PID:11254) Killed: No From the above email example you can see that, here the alert is for excessive memory usage from the server for a particular user. You can avoid this e…

How to Restore Backups from Amazon S3 through SSH - Solved


I have the backups configured correctly and they are backing up to S3 but I am trying to restore an account that got deleted by whmcs. 

I goto Backup Restoration and none of my accounts are listed and the date selectors are not displaying any valid date range choices. 

I also am having issues logging in ssh I get the following error "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)."

So as a temporary solustion I have logged into the clients newly re-created cpanel account used the backup restore wizard and uploaded the .tar.gz file from the downloaded version on S3. 

I guess its a long way to work around this but will this single upload restor mysql, email and directory contents or will I have to upload 3 versions of the file because I had three option on the restore. 

Thanks in advance for any help just trying to get this handled before the client wakes up in the morning and sees his ecommerce site is down.

- - - Updated - - -


Files just finished uplo…

No input file specified - PHP Error on Codeigniter

Just add the ? sign after index.php in the .htaccess file : RewriteEngine on RewriteBase/RewriteCond%{REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-d RewriteRule^(.*)$ index.php?/$1 [L] and it would work !

.htaccess php file downloads instead of being Opened with CPanel - Solved

.htaccess should have following directive in a correct manner otherwise it shows the following error in apache error log which can be seen in logs section of cpanel.

AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

AddHandler application/x-httpd-php53.php won't work and will give the following errors so use AddType Directive instead.

Error Log:

[Wed Jun 25 00:19:45 2014] [alert] [client] /home/idoidoco/public_html/.htaccess: AddHandler requires at least two arguments, a handler name followed by one or more file extensions
[Wed Jun 25 00:19:45 2014] [alert] [client] /home/idoidoco/public_html/.htaccess: AddHandler requires at least two arguments, a handler name followed by one or more file extensions
[Wed Jun 25 00:19:45 2014] [alert] [client] /home/idoidoco/public_html/.htaccess: AddHandler requires at least two arguments, a handler name followed by one or more file extensions
[Wed Jun 25 00:19:45 2014] [alert] [client…

How to manually restore a database.gz file via ssh

How to manually restore a database.gz file via sshLast Modified: Feb 10, 2011, 8:42 pmIf you've got a very large database.gz file, it's often easier to upload first, and restore in a seperate step.
1) Once you've got the gz file uploaded onto your server, login to ssh and cd to the path where the file is located. cd /path/to/your/gz/file
2) The next step is to extract the gz file into it's raw sql form (text).  To do that, use the gunzip program, eg: /usr/bin/gunzip < database.gz database.sql This should have extracted the gz file into the sql in plain text form.

3) Before you can load the sql file into mysql, you'll need to ensure you have the database and database user created.  Go to User Level -> MySQL Management, and create the empty database normally through DA.

4) To restore the sql to mysql, run the following command: mysql -udbusername -ppasswordusername_dbname < database.sql where you'd replace the bold entries with the applicable values.

This cou…

Linux ls Command: Sort Files By Size

ow do I sort all *.avi or *.py files in $HOME/Download/ directory by file size using Linux ls command line utility?

The ls command is used to list directory contents under Linux and Unix like operating systems. If no options or operands are given, the contents of the current directory are displayed on the screen. By default entries are sorted alphabetically if none of the -cftuvSUX nor --sort option passed to the ls command.
Tutorial detailsDifficultyEasy (rss)Root privilegesNoRequirementsGNU ls/BSD lsEstimated completion time1m The default output (sort by alphabetically) Type the following command: $ ls
$ ls *.py
$ ls *.avi Sample outputs:

The mysql server is currently offline


I have created a symbolic link '/tmp/mysql.sock' pointing to the MySQL socket file '/var/lib/mysql/mysql.sock' to resolve the issue. Right now, Restore a Full Backup link is working fine:


1) Your hostname was set to just *****.com - You can't do this on a cPanel server. I changed it to ***.*****.com

2) The domain was then missing from /etc/userdomains - I ran /scripts/updateuserdomains --force to fix it.

How to Server Stop, Start, Restart (Apache, SSH, MySql, Qmail)

Server Stop, Start, Restart (Apache, SSH, MySql, Qmail)

Apache: Q. I’m using CentOS / RHEL / Fedora Linux server and I’d like to restart my httpd server after making some changes to httpd.conf file. How do I restart httpd? A. You can use service command to restart httpd. Another option is use /etc/init.d/httpd service script. Login as root user and type the following commands: Task: Start httpd server:# service httpd start Task: Restart httpd server:# service httpd restart Task: Stop httpd server:# service httpd stop
Please note that restart option is a shorthand way of stopping and then starting the Apache HTTPd Server. You need to restart server whenever you make changes to httpd.conf file. It is also good idea to check configuration error before typing restart option:
# httpd -t
# httpd -t -D DUMP_VHOSTS
Sample output: Syntax OK Now restart httpd server:
# service httpd restart
Where, -t : Run syntax check for config files-t -D DUMP_VHOSTS : Run syntax check for config files and show parse…

How to Delete all logs in a cpanel server - SSH

The command below will delete/empty all files in '/path/to/the/logdirectory' directory.

for i in $(find /path/to/the/logdirectory -type f); do echo > $i; done
You can empty the logs files via SSH as user root using the 'echo' command

echo > /path/to/the/logfile

You should be aware of the list of different log files on a cPanel server.

BTW, why are you looking to delete the log files from your server? If the problem is with the limited disk space, you can always use Log Rotation to rotate the log files in timely manner and delete old logs.

The path to various logs files on a cPanel server for different services is listed below: Apache Web Server Logs: /usr/local/apache/logs/access_log
Exim (Email) Logs: /var/log/exim_mainlog
Ftp Logs: /var/log/messages Mysql Logs: /var/lib/mysql/server.hostname.err Cronjob Logs: /var/log/cron Server Logs: /var/log/messages SSH Logs: /var/log/secure cPanel Installation Logs:

is it possible to specify a different ssh port when using rsync?- SOLVED

Your command line should look like this: rsync -avz --rsh 'ssh -p 19850' --progress /home root@<Host Name>:/backupthis works fine - I use it all the time without needing any new firewall rules - just note the SSH command itself is enclosed in quotes.

How to find your AWS Access Key ID and Secret Access Key

Update: Since April 21, 2014 AWS changes the policy on the use of keys: the secret key retrieving is no longer possible. So you should be extremely careful when creating the credentials for root account and users accounts. The secret key you can see only once immediately after creating. In this way on the root credentials page "Your Security Credentials - Access Key(s)": 1. Select "Create New Access Key"... 2. ... and store keys immediately by option "Download Key File" or manual copy key's text from the screen. The same applies to IAM users. No way to see the secret key except immediately after creating. You will need to do the same actions: create a new keys then copy or download the keys data. Attention!If you do not store the key data before you press "Close" or "Cancel" you will not be able to retrieve the secret key in future. Then you have to delete the keys which you created and started to create the new keys. Note: As a best…