How do I point my domain to my website that's hosted on an AWS EC2? - wordpress

The registrar for my domain is godaddy, I go to their DNS records section and I changed the A name to the elastic IP associated with my instance. Now when I type my domain in the browser, my website appears! However, it forwards it to the IP of my server.
Things I've tried (whether logical or not):
I'm using wordpress multsite so I changed the DOMAIN_CURRENT_SITE in wp-config.php to my new domain. No luck. Reverted.
I changed the 'site_url' and 'home' in my database to point to my domain. No luck. Tried one at a time etc. Reverted.
Changed ServerName to my new domain in httpd.conf (apache).
sudo hostname www.... (don't know what that does)
So I'd like to simply have my website open without it showing the IP in the address bar. Can someone help?
Thanks
EDIT:
Here's the DNS page of godaddy, I've blanked out the ip in the A records, but it's just the ip of my server.

First you need to set Custom NS in godaddy with AWS dedicated IPs then set them as DNS. If you are using Linux instance with cPanel then just add the domain in cpanel's addon-domain.
If you are using Windows instance then you should configure IIS.

Related

How to host the main domain and subdomains at 2 different hosting sites from godaddy?

I have bought the domain from godaddy.
And I have designed the UI which is the main site hosted at say webflow or wordpress.
Now I want to host the dashboard of the main site to the subdomain of this main site from heroku.
How to achieve that?
Domain bought: goDaddy
main site: abcd.com
sub domain: dashboard.abcd.com
main site hosted at: wordpress
sub domain hosted at: abcd.herokuapp.com
Now I want to change the subdomain abcd.herokuapp.com to dashboard.abcd.com
I tried creating an 'A' record at goDaddy DNS settings for dashboard.abcd.com but it wants me to enter an IP address of heroku but when I created a DNS Zone in Heroku for dashboard.abcd.com, it doesn't seem to provide an IP address. It only provides the DNS Target value.
I laso tried to put the abcd.herokuapp.com in Goddaddy dns settings in Points To field but it doen't accpets it. It requires an IP address.
Heroku uses dynamic IP address for the dynos so it’s impossible for Heroku to provide an IP address instead it provides a DNS target. Unfortunately GoDaddy doesn’t support ALIAS/ANAME records. You might want to check out other DNS providers who support ALIAS/ANAME out of the box to configure the APEX domain.

Create a subdomain and point it to domain location

So I have a follow up question based on How To Setup Subdomains on iis
I am using IIS 8, and I am looking to point my subdomain to my current default website. Currently we have www.mydomain.com, and I setup a subdomain in our DNS A Record that is account.mydomain.com pointing to the same IP address of mydomain.com.
I figured the way to create the subdomain is now to go to Site Bindings under the Default Website in IIS and add a site binding with the hostname account.mydomain.com but I am getting an error that says the server IP address cannot be found. The reason I didn't want to create a new Site in IIS is because we have certain properties and permissions that are setup.
Eventually we will be changing the IP Address of www.mydomain.com to be pointing to something new, but for the time being we need account.mydomain.com to point to the same location as www.mydomain.com
Images for reference -

Amazon Web Services - EC2: How do I stop my WordPress site showing the ip address as the domain?

I am close to tearing my hair out on this issue as I just cannot seem to get my Wordpress site to not read the Amaazon Public IP address.
I have a domain name in GoDaddy and have changed a host record so that my domain name "http://example.com" redirects to "http://0.0.0.0".
However once this page loads, the url quickly changes back to the Public IP address.
I have tried changing the Site URL in the Wordpress Settings but this just breaks the site and does not allow me to log in.
What is it I am doing wrong? I just cant figure it out. I just want the domain name from goDaddy to appear as the URL.
Thanks.
First of all attach the Elastic IP to your EC2 Instance so it wont change public IP after you shutdown and restart your machine. Make A Record in your Godaddy DNS Record File that points to the elastic IP.
You have not changed the base URL of your wordpress thats why it is still redirecting to the old Base URL. Connect to your EC2 instance and edit wp-config.php add the following line of code
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Not able to browse website through using domain name on IIS server

I have got a strange problem while setting up my .NET website on IIS server on Amazon EC2 instance.
I have created a new website giving its path to my website folder in IIS 7.5.
I have given the ip address and DNS in domain settings.
And configured the host name in bindings section of website with www.domain.com
I am able to browse it through the IP address but not able to browse it using domain. It is showing some service page...
Can any one help me?
You need to configure your host header in IIS. Here's how to do it on IIS 6.0 for example:
http://www.visualwin.com/host-header/
Also, does www.domain.com actually resolve to your IP address?
It sounds like the A record for for the domain isn't set to the correct IP address. Have you confirmed that the changes took AND that they've propagated to your computer? If you ping www.domain.com, do you get the correct IP?

How to set up subdomains on IIS 7

I have a website sitting on an IIS 7 server:
WWW.example.COM
I would like to create several sub domains that looks like
SUBDOMAIN1.example.COM
I created an IIS website and I set the bindings to be
http, port 80, the ip address of my server, and SUBDOMAIN1.example.COM and the physical path to a folder under example.COM
I restarted my website and clicked on browse, the browser than opened with the address:
http://SUBDOMAIN1.example.COM
But the website doesn't show up.
Do I have to do something with the DNS?
This one drove me crazy... basically you need two things:
1) Make sure your DNS is setup to point to your subdomain. This means to make sure you have an A Record in the DNS for your subdomain and point to the same IP.
2) You must add an additional website in IIS 7 named subdomain.example.com
Sites > Add Website
Site Name: subdomain.example.com
Physical Path: select the subdomain directory
Binding: same ip as example.com
Host name: subdomain.example.com
Wildcard method: Add the following entry into your DNS server and change the domain and IP address accordingly.
*.example.com IN A 1.2.3.4
http://www.webmasterworld.com/microsoft_asp_net/3194877.htm
If your computer can't find the IP address associated with SUBDOMAIN1.example.COM, it will not find the site.
You need to either change your hosts file (so you can at least test things - this will be a local change, only available to yourself), or update DNS so the name will resolve correctly (so the rest of the world can see it).
As DotNetMensch said but you DO NOT need to add another site in IIS as this can also cause further problems and make things more complicated because you then have a website within a website so the file paths, masterpage paths and web.config paths may need changing. You just need to edit teh bindings of the existing site and add the new subdomain there.
So:
Add sub-domain to DNS records. My host (RackSpace) uses a web portal to do this so you just log in and go to Network->Domains(DNS)->Actions->Create Zone, and enter your subdomain as mysubdomain.domain.com etc, leave the other settings as default
Go to your domain in IIS, right-click->Edit Bindings->Add, and add your new subdomain leaving everything else the same e.g. mysubdomain.domain.com
You may need to wait 5-10 mins for the DNS records to update but that's all you need.

Resources