Change website

From Jan 16 2015,


All post content will be move to we's offical website with many content...

Can access website here: http://justox.com

Thanks for your visit!

Friday 27 December 2013

Creating a PHP ICO Creator for Favicons

For the past couple of weeks, I have worked on creating a PHP library to create ICO files. This has been difficult as all the documentation for the ICO format is either sparse or not completely documented.

Fix WHM/cPanel cPHulk Brute Force Protection Lock Out Via SSH

message:
Brute Force Protection
This account is currently locked out because a brute force attempt was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.

How can I add an IP address to my Linux Server


Adding an IP address to a CentOS server is very easy.
  • Go to the network configuration directory /etc/sysconfig/network-scripts
  • Create a file with the name ifcfg-eth0:1 (This file increments, so if you already have several IP addresses you need to add the next increment, such as ifcfg-eth0:3 for the 4th IP)
  • Paste the following contents into the file:

Analyzing disk space usage on a linux server


du -chs command

To locate which directories may be using an excessive amount of disk space, you can find them by executing the du -chs command as shown.  This will show how much disk space is used by each subdirectory.

How to mount your recently slaved drive: (linux)


If your server has recently been re-installed with a new hard drive and your old drive has been slaved so you can recover data, here is how to mount your old drive and access your files.

How to block IP address in Linux via ssh:


The following command will drop any packet coming from the IP address 1.2.3.4:

iptables -I INPUT -s 1.2.3.4 -j DROP

or you can use append

How to change the primary IP addres of a WHM/cPanel server


Steps in WHM:

  • Log into WHM and go to Basic cPanel & WHM Setup
  • Change the Primary IP here with the option that says "The IP address (only one address) that will be used for setting up shared IP virtual hosts"
  • Note: This might not actually be necessary.
  • Thursday 19 December 2013

    Allowing Users to Customize AwStats

    You can allow users to use their own configuration file for AwStats in case they are in need of customizations not provided by the server’s main config. To enable this option, add the following to /etc/stats.conf:
    allow_awstats_include=1
    Alternatively, you can go to WHM > Statistics Software Configuration, and click on Allow Awstats configuration Include file
    This will allow users to have an awstats.conf.include file in /home/$username/tmp/awstats, which can be used to override settings from the main AwStats configuration for the server.

    Removing WHM Disk Space Errors

    If your server is approaching 99% disk space, your users may be aware of this before you are. At the 1% free margin, the following error will pop up when accessing certain features in cPanel and WHM:

    Quota Errors in Exim’s Panic Log

    In cPanel 11.25, you may be seeing errors like this in /var/log/exim_paniclog:
    2010-04-15 12:33:27 failed to expand condition "${if exists {$home/etc/$domain/quota}{${if > {${lookup{$local_part}lsearch{$home/etc/$domain/quota}{$value}{0}}}{0}{${if eq {${if exists {$home/mail/$domain/$local_part/maildirsize}{1}{0}}}{0}{${if > {${run {/usr/local/cpanel/bin/eximwrap GETDISKUSED $local_part $domain}}}{${lookup{$local_part}lsearch{$home/etc/$domain/quota}{$value}{0}}}{true}{false}}}{${perl{checkuserquota}{$domain}{$local_part}{$message_size}{${lookup{$local_part}lsearch{$home/etc/$domain/quota}{$value}}}{$home/mail/$domain/$local_part/maildirsize}}}}}{false}}}{false}}" for virtual_user_maildir_overquota router: absolute value of integer "10485760000" is too large (overflow)
    To fix this, run :
    /scripts/reset_mail_quotas_to_sane_values –force –confirm –verbose