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!

Showing posts with label Cpanel/WHM. Show all posts
Showing posts with label Cpanel/WHM. Show all posts

Friday 27 December 2013

Fixed Nginx: 413 Request Entity Too Large Error and Solution

'm running nginx as a frond end to php based Apache+mod_fastcgi server. My app lets user upload images upto 2MB in size. When users trying to upload 1.5MB+ size image file using nginx reverse proxy, they are getting the following error on screen:
Nginx 413 Request Entity Too Large
How do I fix this problem and allow image upload upto 2MB in size using nginx web-server working in reverse proxy or stand-alone mode on Unix like operating systems?
You need to configure both nginx and php to allow upload size.

Cpanel Database Backup

The database would be stored in MySQL's base directory, which by default is /var/lib/mysql. If a different base directory is used, it would be specified in /etc/my.cnf.

not recommend simply copying the database files. While this can often work, the approved MySQL method is to create a dump, and use the dump to import the database on the "new" server. The basic syntax is the following on the "old" server:

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 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

    Fatal! Write failure for /etc/valiases/..

    When adding an email forwarder you may see an error like this:
    Fatal! Write Failure: /etc/valiases/thecpaneladmin.com. Ignore any messages of success this can only result in failure!
    To fix this, run (replace user with username and domain with the domain name)
    chown user:mail /etc/valiases/domain.com
    chmod 644 /etc/valiases/domain.com

    User Databases Missing from cPanel

    After upgrading to cPanel 11.28, a number of our users indicated that databases were missing from their cPanels, despite the actual databases existing on the server. There are a number of things that can cause this, including corrupted Perl modules and MySQL not running, but the major cause that I’ve seen is from the new database mapping functionality.

    cPanel Update Fails with Exit Code 6400

    Since the release of cPanel 11.32, the cPanel update process has extended OS checks to ensure that you are only updating cPanel on a compatible system. Specifically, you can no longer upgrade past version 11.32 on CentOS 4, or 11.30 on Redhat 9.  Trying to do so will verbosely inform you that the upgrade is not possible.
    However, if you’re running CentOS or RHEL 5 or 6 and still either see this error or a cryptic “exited with code 6400″ message as shown below, it’s usually a simple fix.
    Running `/usr/local/cpanel/scripts/updatenow --upcp --log=/var/cpanel/updatelogs/update.1xxxxxx.log --force` failed, exited with code 6400
    Firstly, if you run the updatenow command directly, you’ll see the error in its true form:
    /usr/local/cpanel/scripts/updatenow –upcp
    Results in:
    Only Distro versions 5 and 6 supported in this version of cPanel & WHM

    But, as you’ve already established, you are running version 5 or 6, but upcp doesn’t seem to recognize that.  To fix this, simply edit /var/cpanel/sysinfo.config and change the value of rpm_dist_ver to the major OS version you are running. For example, if you run CentOS/RHEL 6, you would do:

    Disk Space for MySQL Databases in cPanel Show as 0MB

    When you upgrade from cPanel 11.24 to 11.25, your users may notice that in cPanel, their MySQL databases show 0MB of disk space used, when they know their databases are much larger. This is due to an option in cPanel that you specifically have to enable. To enable MySQL disk usage tracking:
    1) Edit /var/cpanel/cpanel.config
    Change:
    disk_usage_include_sqldbs=0
    to
    disk_usage_include_sqldbs=1
    Then run the following:
    /scripts/update_db_cache
    This may take a few minutes if you have a ton of users with databases, but after this, you should see the database disk usage show up accurately in cPanel.

    Roundcube: MySQL or SQLite?

    cPanel 11.25 introduces a new feature: The ability to have RoundCube use SQLite instead of MySQL. After benchmarking resource usage and performance, I’ve come to the conclusion that SQLite is definitely the best way to go for Roundcube. Having trou
    ble making the decision? This article may help clear things up for you.

    Restoring Database Privileges

    I’ve seen several cases in the last few months where database users seemingly “disappear” or privileges appear to become invalid when restoring MySQL data or an entire server from raw backups. This may commonly be attributed to a MySQL version mismatch, for example, when a server is running MySQL 5.0 and then is suddenly running MySQL 5.1 or higher (or data is directly restored to a server running such), without having the database tables updated.

    How to Change the Location of MySQL on cPanel

    There may be some situations where you have to move the location of MySQL, for example, if you’re out of disk space or perhaps looking to host it on another device to increase performance. Whatever the reason, moving MySQL is simple and has no impact ct on cPanel’s functionality.

    10 Tips for Improving Email Delivery

    One of the most common problems that hosting providers face is the issue of user email not being delivered to other mail servers. Not only does it annoy the end user, but it’s extremely frustrating for the server administrator to deal with since there’s not always a clear indication of why email doesn’t get delivered successfully. In this post I’ll explain a few tips for helping improve the reliability of your mail server, and some tips you can give to your end users that send mailing lists.’

    Using Custom RBL’s with Exim and cPanel

    cPanel 11.28 introduces an way to easily implement your own RBLs for Exim to perform lookups against.  To get started, log into WHM > Exim Configuration Editor and click on the RBLs tab, then Manage custom RBLs.

    Copy Outgoing Email on a cPanel Server with Exim

    A common request we get is how a user can automatically BCC outgoing email to another address. This is most often requested by law firms that need to be able to retain copies of communication. Forwarding incoming email is easy – there’s already a section in cPanel for it. However, if you want to forward outgoing email there’s a small twist.

    Enhancing Your cPanel SPAM Protection with SpamExperts

    With spam continuing to be an increasing problem, hosting providers are always looking for ways to filter out junk so their customers remain as spam free as possible. SpamAssassin, the anti-spam software bundled with cPanel, will do a sufficient job in filtering some spam, but to truly get bragging rights as a spam-free host, you need something stronger.

    Exclude Domains from RBL Checks for Incoming Email

    Update: This feature is automatically enabled as of cPanel 11.36.1.4
    If you have RBL’s enabled globally on your server, there may be times when you want to keep certain domains from having their mail scanned against an RBL. While cPanel supports excluding sender IP addresses from these checks, some manual Exim modifications are needed to exclude recipient domains.

    Implementing SendGrid with Exim on cPanel

    Setting up your cPanel server to send through a third-party mail server is very easy to do, if you understand the basics of how cPanel builds its Exim configs. You never want to edit your exim.conf file directly – your changes will be wiped out any time a cPanel update runs or someone makes a change via the Exim Configuration Editor in WHM.  Below is a quick guide on setting up a custom mail router with a provider like SendGrid, which in turn will route all outbound email through the external mail service.