skip to Main Content

I tried creating an Amazon EC2 instance with an elastic IP address. In there I deployed a MEAN app by Bitnami.

On the other hand we have a CPanel (not deployed in amazon, I think it’s Apache, not sure, I’m not the one who deployed it)

Cpanel is already pointing to www.example.com so we can access cpanel via www.example.com:2082 but the default www.example.com:80 is blank/empty. We are using Cpanel for our mailing server.

What I need to do is to point Amazon EC2 public IP and DNS to www.example.com:80. Can I set it up in Cpanel DNS Zone Editor? or do I need to set up Amazon Route 53? what do I need?

If I create a new A record in Cpanel DNS Zone editor for Amazon I lose access to Cpanel www.example.com:2082. I’m really confuse right now. Please Help.

2

Answers


  1. You need to introduce a Proxy server in between to do this, As in DNS you can’t set the ports, for each type of requests ports are already defined.
    You can add nginx or haproxy or any other reverse proxy server, which will accept all the requests and passes on the request to appropriate hosts on appropriate ports.

    Login or Signup to reply.
  2. I know it’s a bit late but just in case you still need it or someone comes across this:

    No need for a proxy.

    You point the A record for example.com to EC2 IP.
    CNAME for WWW to example.com
    Then you should have an A record for mail.example.com for your cPanel IP
    Your MX records should point to mail.example.com and not to example.com.
    And you can access cPanel at mail.example.com:2082 or whatever the server's IP or main hostname is. The main hostname has the advantage that you can use port 2083 for SSL cPanel connections
    Just make sure the e-mail clients use mail.example.com and not example.com as the connecting mail server.
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search