EasyApache + Nginx Manager Not Working

Since you’re using EasyApache + NGINX Manager (on cPanel/WHM), Apache and Nginx are working together, where:

  • NGINX acts as a reverse proxy — listening on ports 80 and 443
  • Apache runs behind it — typically on ports like 8080 (HTTP) and 8443 (HTTPS)

Problem:

Your Apache is trying to bind to port 443, but NGINX is already using it, as it should in a reverse proxy setup. Apache should not try to bind to 443 directly.


How to Fix:

Step 1: Check Apache Listening Ports

Run this in SSH:

grep -i listen /etc/apache2/conf/httpd.conf

You should not see Listen 443. If you do, change it to:

Listen 8443

Then restart Apache:

/scripts/restartsrv_httpd

Step 2: Ensure Apache is Set to Run on Alternate Ports (8080/8443)

In WHM:

  1. Go to WHM > Home > Software > NGINX Manager
  2. Click “Settings”
  3. Make sure it says:
    • Apache HTTPS Port: 8443
    • Apache HTTP Port: 8080

If not, update it and save, then restart NGINX and Apache:

/scripts/restartsrv_nginx
/scripts/restartsrv_httpd

Step 3: Check Apache Include Files

Sometimes SSL-related VirtualHosts are misconfigured. Run:

grep -Ri '<VirtualHost' /etc/apache2/conf.d/

Look for entries like:

<VirtualHost *:443>

If found, change to:

<VirtualHost *:8443>

Also ensure SSLEngine on is only in 8443 blocks, not on 443.

Then:

/scripts/restartsrv_httpd

Optional Cleanup Script

If you’d like a quick fix script, here’s a Bash one:

#!/bin/bash
echo "Stopping any stuck Apache processes..."
pkill -f httpd

echo "Checking for anything using port 443..."
lsof -i :443

echo "Restarting NGINX and Apache in proxy mode..."
/scripts/restartsrv_nginx
/scripts/restartsrv_httpd

echo "Done. Check Apache status with: systemctl status httpd"

Save as fix_apache.sh, then run:

chmod +x fix_apache.sh
./fix_apache.sh

Final Step: Confirm it’s Fixed

netstat -tulpn | grep :443

Should show nginx, not apache.

And:

curl -I https://yourdomain.com

Should return 200 OK.




Leave a Reply