How to remove error_log from all CPanel account and backups

Some scripts like WordPress and Joomla can leave a big error_log files that no one will ever look at. Try opening a 30mb log file with Word and see what happens. In most cases you can just remove this file with a simple command.

To remove all error_log files for CPanel accounts that are live use:

find /home/ -type f -name error_log -delete

To remove all error_log files from backups use:

find /backup/ -type f -name error_log -delete

This will take a while to complete because it will look through every file, it also runs pretty smooth so just sit back and let it work it’s magic.

 

How to change the main IP on a CPanel server

Changing a server to a new IP is a nightmare, there is so many places that need to update. If possible always just set up a new server and transfer everything to it. If that’s too hard than here is how to do the migration the best possible way.

  1. Edit /etc/sysconfig/network-scripts/ifcfg-eth0
    Change the IPADDR and GATEWAY lines to match the new IP and Gateway for the new ip
  2. Edit /etc/sysconfig/network
    Change the GATEWAY line here if it does not exist in the ifcfg-* file.
  3. Edit /etc/ips
    Remove the new primary IP from this file if it is present
    Add the old primary IP to this file
  4. Edit /var/cpanel/mainip
    Replace the old primary IP with the new primary IP
  5. Edit /etc/hosts
    Replace the old primary IP with the new one if needed. The hostname’s dns will need to be updated too
  6. Restart the network service to make the new IP the primary: service network restart
    (Note: You’re probably going to be disconnected at this point, and have to log in to ssh using the new primary ip.)
  7. Restart the ipaliases script to bring up the additional IPs: service ipaliases restart
  8. Run ifconfig and make sure all IPs show up correctly
  9. Update the cpanel license to the new primary IP
  10. Then run /usr/local/cpanel/cpkeyclt to update the CPanel license
  11. Then run the migration Wizard inside CPanel to update Apache and the website settings.

In a perfect world that will do it.

Good luck!

How to Install the FFMPEG auto installer from ffmpeginstaller.com

It’s hard to install each option needed for a versatile video streaming script. Luckily the talented guys at ffmpeginstaller.com make an easy to use script to get FFMPEG and all of the extra tools installed.

First grab the auto installer file, you will need to right click the download button and choose to “copy link address” to get the latest version link. For example the current url now is:

http://mirror.ffmpeginstaller.com/old/scripts/ffmpeg8/ffmpeginstaller.8.0.tar.gz

So first run:

wget http://mirror.ffmpeginstaller.com/old/scripts/ffmpeg8/ffmpeginstaller.8.0.tar.gz

Then untar it:

tar -xvzf ffmpeginstaller.8.0.tar.gz

Then go into the folder:

cd ffmpeginstaller.8.0

Now run it!

./install.sh

It will ask you if you want to install everything, just choose yes.

It will install of these:

  • ffmpeg
  • Mplayer
  • A52decoder
  • Amrnb and AmrwbAll
  • codecsfacc and faad2Rubyfdk-aacvo-aacencvo-amrwbenc
  • flvtool2
  • Git
  • Mplayer
  • Lame
  • Libogg
  • Libvorbis
  • Libtheora
  • Libspeex
  • Libflac
  • Libao
  • Libwmf
  • opencoreamr
  • vorbistools
  • X264
  • MP4Box
  • Xvidcore
  • Yasm
  • LibOggz
  • Yamdi