-3

I have a web app running on apache2 at my Ubuntu linux AWS virtual machine, which is currently accessible by an internal amazon sub-domain (like 'ec2-99-99-999-9999.compute-1.amazonaws.com:8080).

I want to make it accessible by an example.com:8080 domain name, that I bought and I have no idea where to begin. I understand that this may be an elementary question but some guidance would be much appreciated.

2

3 Answers 3

2

Assign an EIP to your EC2 instance, then create the DNS record you need (probably an A record for the host @) and point it to the EIP.

2

Your domain registrar should have a control panel which allows you to alter the DNS settings for the domain you have purchased. You will want to alter the A record to be the public IP of your VM (and/or the AAAA record to the equivalent IPv6 address, if you have one). There may be options to delegate the DNS to other nameservers but that's not what you're interested in right now; just use the registrar's DNS.

0

1) Allocate an Elastic IP on your AWS EC2 Panel

2) Assign Elastic IP to your AWS Instance

at this point you can reach your server with the assigned IP. Eg 55.544.433.322:8080

3) Switch to the Route 53 Panel in AWS 4) Here you can register a new Domain, note that this domain is note directly hosted by AWS, but it is seemlesly integrated into AWS

After the Domain got activated (after payement) you:

5) Create a "Hosted Zone" again at your AWS Route 53 Panel

6) Usually the correct NS and SOA Records are correctly set-up. If not, create the proper Record Sets for your Region. Check AWS Help on this.

7) Create a new "A-Record", in the "value" field input your Elastic IP from Step 1

If want to create subdomains like www.domain.com or test.domain.com You crate another A-Record where "name" is the first part of the domain (eg www or test) - the IP is remains the allocated IP.

You could skip step 1 and 2 but assigning an elastic IP to your instance assures that your IP stays the same even if you shutdown your system. Also you can always assign the EIP to any instance without changing the DNS-Records.

If you want your service running on port 8080 to be available without :8080 you have to setup eg. nginx as port-proxy.

7
  • Thank You! I followed your instructions but now when I go to greychat.net I get a 403 Forbidden error and when i go to graychat.net (I followed the same steps for another domain that I own) I get a development home page that I don't recognize and is different then when i type by elastic IP into the browser. I'll add screenshots
    – frankgreco
    Jan 10, 2016 at 17:47
  • imgur.com/SYITpVw
    – frankgreco
    Jan 10, 2016 at 17:52
  • imgur.com/ZsHmFGw
    – frankgreco
    Jan 10, 2016 at 17:52
  • A 403 Error is generally not a problem with DNS records. Check your permissions. Has the apache user permissions to read the documents in var/www ? Also keep in mind that DNS changes need some time to propagate, but usually AWS "hosted" Domains change pretty fast. You said that your service listens on port 8080, your virtual host posted on your other question is listening on port 80. It is possible that apache recieves your request but has nothing to serve. If you think my answer was helpful please mark it as useful or as answer so other users find it quicker.
    – G-M
    Jan 11, 2016 at 17:22

Not the answer you're looking for? Browse other questions tagged .