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

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');

Related

URL for Wordpress site not working (err: DNS_PROBE_FINISHED_NXDOMAIN)

I have the domain 'alexdollard.xyz' registered with Google domains
I added the custom resource record 'wp' as a type A, and pointed it to my digitalOcean droplet (a Wordpress instance)
I then added a CNAME record for www, and pointed it at my Netlify-hosted site. (This Netlify site is a gatsby/react site which will query my wordpress instance for blog-post data)
When I ping the IPv4 address of the wp subdomain in my terminal, I get a response. But when I ping 'wp.alexdollard.xyz', I get unknown host. And when I run it in the browser I get "wp.alexdollard.xyz’s server IP address could not be found."
I've been working with this subdomain for a while now and this issue just started. wp.alexdollard.xyz was working until yesterday.
I have already tried renewing my DHCP Lease, flushing my dns cache, and changing my DNS servers to public servers. For context, this issue didn't start until I deployed the site to Netlify, and pointed the google DNS name servers for alexdollard.xyz to the Netlify name servers. But wp.alexdollard.xyz should still point to this digitalOcean droplet since it's a subdomain, right?
I'm sorry if this question is sophomoric or dumb, it's possible that I really just don't understand the basics of DNS configuration. Seems like something simple is going on. What is causing this issue with my DNS?
DNS entry seem correct:
dig a wp.alexdollard.xyz
;; ANSWER SECTION:
wp.alexdollard.xyz. 3600 IN A 134.209.73.194
it is also resolving globally: https://www.whatsmydns.net/#A/wp.alexdollard.xyz
I can see two options here:
your local DNS is stil propagating or needs to be flushed
your droplet is not accepting this 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 -

Point a url to another ip

I have a small website hosted in aws server. I do not want to write a blog engine so I want to use wordpress in cpanel.
Lets say my blogs will show up in domain/blogs url. will it be possible to somehow show the blogs from the wp cpanel when user visits that url and if the user only visits domain.com then they shud be in the aws server.
It seems that you want to keep the website with AWS and host your blog with any other provider.
You can do that via creating the subdomain like blog.domain.com.
1.Get Wordpress hosting with blog.domainname.com and your web host will provide the IP address of their web server.
2.Just go to DNS manager of your domain and add following A record.
blog.domain.com >> webhost's given IP address.

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

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.

Change ip issue

I have added a new floating ip to my VPS (digital ocean - CentOs7) and I have added this in WHM and I have bind this ip to a domain. I have point domain's DNS correctly to my new ip.
But when I go in my domain I view this:
error page WHM cPanel
Please try to access your IP through browser and check which page are you getting. if you correctly setup your domain on that IP, then you will your site home page at : http://IP
Also try to rebuild httpd configuration file on your server through following command
/scripts/rebuildhttpdconf

Resources