Fix Apache NAT Problem on cPanel

Your apache server after hardening, mod_lsapi and NGINX as reverse proxy. Source: Millitary.com.
An Apache after security hardening, mod_lsapi and NGINX as reverse proxy.
source: millitary.com

Since the update 11.58, I noticed that cPanel NAT solution wasn’t working with Apache on Amazon Web Services and Google Cloud Engine.

Apache was using the public IP on the VirtualHost. Bad bad boy.

As far as I’m concerned, you don’t want to change the public IP to the internal IP every time some httpd.conf edition is made.

Solution

  1. WHM -> Server Configuration -> Basic cPanel & WHM Setup;
  2. On the “The IPv4 address (only one address) to use to set up shared IPv4 virtual hosts.” field, change the public IP to the internal IP;
  3. Save the page.

You’ll see that cPanel will change for the public IP again. However, you don’t have to edit again.

From now on, Apache will use the internal IP even with the public IP on the “Basic cPanel & WHM Setup”.

I have my thoughts about why it happens, but since I don’t like to ask for support, that’s my way of fixing it. Do you have another solution?