Category Archives: Linux Admin

cpanel check disk space and make space

Delete cPanel File Manager temp files

rm -fv /home/*/tmp/Cpanel_*

 

Remove cPanel update archives

/usr/local/apache.backup*

 

Clean up Yum files

yum clean all

 

Remove pure-ftp partials

locate .pureftpd-upload | xargs rm -fv

 

find directories larger than ‘x’mb

du -sm * | awk ‘$1 > 1000’

 

find files larger than 100mb

find . -type f -size +100M -print0 | xargs -0 du -chs

 

tmpDSK removing all files from tmpdsk except the last 6 hours

tmpwatch –all -mf 6 /tmp

 

Type the following command at the shell prompt to find out top 10 largest file/directories:

du -a /var | sort -n -r | head -n 10

php file infection

this will strip a text section out of all files when run the the directory

find . -name “*.php” -exec sed -i ‘s/<?php $irmsykfenq.*$soyyhllyjf-1; ?>//’ ‘{}’ \;

the blue text is your from and to, in that you should have an example of the inserted text to copy the start and the end section, kinda like

$irmsykfenq. lots of clever code here $soyyhllyjf-1;

so you run that and it removes your definers and everything in between.

 

WordPress timing out on you when you edit a menu…

cPanel, WordPress

if you edit a menu and get a 500 or 404 and also see something like max_input_vars limit too low.

edit your php.ini and adjust or add

max_input_vars = 5000

then restart Apache.

Oh yeah this is due to the limit on menu items php imposes on wp.

Other factors round this issue were a messy htaccess file and also permalinks, so check that too.

cpanel, horde, Login failed because your username or password was entered incorrectly.

When trying to access Horde it shows an error below when you click on Log In. Even if you use the correct login details it does not allows you to enter.

‘Message Login failed because your username or password was entered incorrectly.’

This is because due to incorrect permissions on the files & directories on etc & mail directory under the account. Login to your server via SSH & execute commands below.

/scripts/mailperm

Once the updates are completed, try accessing the Horde. It should allow you to enter.

 

Message Login failed because your username or password was entered incorrectly.