How to Install and Enable cPanel Proxy?

Posted by admin     Category: cPanel Management

cPanel, WHM and even Webmail uses non-common ports which some Internet Server Providers (ISP) do not allow and makes it impossible for people to access any of these. cPanel works on 2082/2083, WHM 2086/2087 and Webmail 2095/2096.

The workaround is to install cPanel Proxy which works as a proxy gateway for Apache and the requests to cPanel/WHM/Webmail are then served through port 80 instead of their respective ports which are blocked by the ISP.

Here’s how to Install cPanel Proxy:
——————————————————————————–
1. You have to recompile Apache with the cPanel proxy module.
a) You can either execute ‘/scripts/easyapache’ script via SSH
OR
use WHM -> Software -> ‘EasyApache (Apache Update)’ option.

b) On the next step, leave the current profile as it is and click ‘Start Customizing Based on Profile’

c) Click ‘Next Step’ in the Apache/PHP selection pages and goto the 5th step

d) On the Short Options List, click ‘Exhaustive Options List’ button to list all the Apache/PHP modules.

e) Scroll down a bit and select the “Proxy” module

f) Click ‘Save and Build‘ and proceed to build Apache with the Proxy module.

It may take around 30 minutes for the process to complete. Once the module is compiled, a VirtualHost entry for the cPanel/WHM/Webmail sub-domains is added in the Apache configuration file.

Here’s how to Enable cPanel Proxy for an Existing account:
——————————————————————————————————————————–

2)  The next step is to add ‘A’ records for cPanel/WHM/Webmail for the domain you need to enable proxy access on. To add the records, goto

a) Goto WHM ->  DNS Functions.

b) Click ‘Edit a DNS Zone’ option and select the domain to edit and click Edit.

c) Scroll down to the empty boxes and add the following records

cpanel 14400 IN A ServerIP
whm 14400 IN A ServerIP
webmail 14400 IN A ServerIP

where, ‘ServerIP’ is the actual IP of the server.

d) Click ‘Save’.

Once the records are added, allow sometime to propagate and then you should be able to access cPanel at, http://cpanel.yourdomain.tld. You will be able to access WHM/Webmail the same way.

Webmail login error: Your Internet Address has changed since the beginning of your Mail session.

Posted by admin     Category: cPanel Management, Plesk Management

Sometimes you see the following error at the middle of your Webmail Horde session :

Your Internet Address has changed since the beginning of your Mail session. 
To protect your security, you must login again.

This error mostly occurs when the ISP is using proxy servers to filter the browsers content. The proxy server randomly change its IP address and thus cause you to fail the web mail security measures.

The solution is to turn off the ‘checkip’ parameter in the Horde’s configuration file.  The configuration file is located as follows:

cPanel server : /usr/local/cpanel/base/horde/config/conf.php
Plesk server  : /usr/share/psa-horde/config/conf.php

Edit the respective configuration file depending on the control panel you have and look for

$conf['auth']['checkip'] = true;

replace it with

$conf['auth']['checkip'] = false;

This is it. Please note, this is a server wide change and cannot be done on user basis.

Horde: there are no parts that can be displayed inline.

Posted by admin     Category: cPanel Management, Plesk Management

While accessing an email using Horde, you may notice that Horde isn’t displaying the contents of the email rather it displays the following message

"there are no parts that can be displayed inline."

The reason is the “inline” setting of the HTML driver is set to false. To fix the issue, you need to enable i.e. change false to true for  “imp/html/inline” attribute in the Horde’s mime_drivers.php file.

On a cPanel server, the file is located at /usr/local/cpanel/base/horde/imp/config/mime_drivers.php and the attribue it as:

$mime_drivers['imp']['html'] = array(
 'inline' => false;

On a Plesk server, the file is located at /etc/psa-horde/imp/mime_drivers.php and the attribute is as:

$mime_drivers['imp']['html']['inline'] = false;

Once you change the attribute to ‘true’, save the file and Horde will start displaying the contents of the email.

Exim: 451-The server reached its limit for processing requests from your host

Posted by admin     Category: cPanel Management

Recently I had a problem while sending emails to a specific server and while looking at the logs I saw the following:

451-The server has reached its limit for processing requests from your host.
\n451 Please try again later.
T=remote_smtp defer (-53): retry time not reached for any host

The reason could either be the exim rate limiting the number of emails OR the exim databases are corrupted. In such a case, you have 2 options

1) Increase the number of emails each domain can send per hour from WHM >> Tweak Settings >> Max hourly emails.

2) If step 1 does not help, its clearly a case of exim database corruption, and to resolve the issue using the exim database tool called “exim_tidydb”. SSH to your server and execute:

# /usr/sbin/exim_tidydb -t 1d /var/spool/exim retry > /dev/null
# /usr/sbin/exim_tidydb -t 1d /var/spool/exim reject > /dev/null
# /usr/sbin/exim_tidydb -t 1d /var/spool/exim wait-remote_smtp > /dev/null

Once done, reinstall courier and exim using the cPanel scripts.

# /scripts/courierup -- force
# /scripts/eximup --force

You should now be able to send emails from the server.

How to enable allow_url_fopen for a single domain on a cPanel server?

Posted by admin     Category: cPanel Management

The way to enable allow_url_fopen on a phpsuexec and a non-phpsuexec server is different. For security reasons the option is mostly disabled server wide, however, you can turn it ON for a single domain/account incase it is required.

Here how it needs to be done.

  • On a non phpsuexec server:

Goto the /usr/local/apache/conf/ directory,

# cd /usr/local/apache/conf/

see if you have a “userdata” directory there? If not, create the “userdata/<username>” directory and then the file allowurl.conf inside it. So the complete path should look like:

# pico /usr/local/apache/conf/userdata/<username>/allowurl.conf

and add the following to the file

<IfModule mod_php5.c>
 php_admin_value allow_url_fopen On
 php_admin_value allow_url_include On
</IfModule> 

Now, edit the Apache configuration file and scroll down to the VirtualHost entry of the domain. Include the path of the above created file in it, as shown below:

Include "/usr/local/apache/conf/userdata/<username>/allowurl.conf"

Save the file and rebuild the apache configuration

# /usr/local/cpanel/bin/apache_conf_distiller --update
# /usr/local/cpanel/bin/build_apache_conf
# /scripts/restartsrv httpd

This will enable allow_url_fopen for that domain.

  • On a PhpSuExec Or SuPHP server:

On a SuPHP enabled server, turning ON allow_url_fopen in the VirtualHost entry won’t work since PHP is not working as a Apache Handler anymore.

In such a case, copy the global php.ini of the server under directory of the domain, say public_html (you need to copy php.ini to the directory, where your script with allow_url_fopen resides)

# cp /usr/local/lib/php.ini /home/<username>/public_html/

Edit the new php.ini file and enable allow_url_fopen in it

allow_url_fopen = On

Save the file. Thats it.

BTW, replace “<username>” with the actual username of the domain wherever stated above.