Setting up a custom domain with Amazon S3 - amazon-s3

I bought a domain name through iwantmyname.com and got stuck setting up the static website hosting though S3 when following this guide: http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
What I want is to set everything up so that when someone goes to mydomain.com they see my index.html file hosted on S3 and the URL should not change to something else like mydomain.com.s3-website-us-west-2.amazonaws.com I just want it to be mydomain.com
I got stuck on everything past Step 3.2 where it has me configure the Route 53 stuff. Does anyone have a better step by step guide for this? Amazon didn't do a very good job, possibly on purpose to entice people to buy their support.

Figured this out on my own. Here is what needs to be done:
buy your domain, example.com
go to the Amazon S3 console and create a bucket named example.com
add your index.html file to it and provide read permissions
enable static website hosting for the bucket, using example.com in the field
go to the R5 routing part of the console and add a Type A record set (IPV4)
Select Yes for Alias and choose the endpoint from the drop down, it will be something like
example.com..s3-website-us-west-2.amazonaws.com
Hit 'Create'
Go back to Hosted Zones and click the example.com zone, on the right you will see 4 namespaces that look something like this:
ns-XXXX.awsdns-54.org
ns-XXX.awsdns-15.com
ns-XXXX.awsdns-45.co.uk
ns-XXX.awsdns-27.net
Copy these namespaces to a notepad or something
The Amazon side is now configured, we just need to do the domain side, so in my case I went to iwantmyname.com
Go to edit namespaces, and change them to the ones you copied from step 8
We're done! Just be patient as it does take some time to configure all of this. In my case it took about 15 minutes. You can ping the website or use nslookup to check up on the progress through your console:
ping example.com
nslookup example.com
pinging is inferior to nslookup with S3 since Amazon blocks them

Related

Google Domain forward to Digital Ocean linux server, running Apache2 subfolder, and display domain as root

I've been googling for a bit now, and I really cant seem to figure this out. I recently bought a domain name with google domains, that I wish to point to a sub domain on my web-server, (example) http://120.0.0.0/sub-folder/, while apearing as domain.com.
Right now I have mbektic.com forwarding to http://138.197.5.88/mbektic/ which kind of gets what I need done, but I wish for the URL to say mbektic.com, instead of the ip address of the server.
Now I've been looking around and I've found things mentioning things from creating records to .htaccess files, and honestly I'm completely lost.
If someone could point me to a straightforward guide or give me a list of steps to follow, I can do it myself, but currently I am just lost.
This really belongs on unix.se since it isn't programming...
That said, what you need to do is set up a DNS A record pointing your domain name to your IP address. Add a second one to handle www.example.com
Then, on the webserver, configure it to respond to that name and serve content out of the directory you specify (the apache webserver calls this the DocumentRoot - you may want to look up apache virtual hosts .... )

How can I host my website on an EC2 Server using Apache but host my images on S3 under the same sub domain?

So I have my website hosted on an EC2 server running apache. All works fine and well.
The issue I'm having is that I want my images hosted on S3 (and possibly cached on CloudFront), not on my EC2 server, but want both accessible under the same domain/subdomain.
For example say my website is www.helloworld.com. I want my images to be accessible at www.helloworld.com/images/foobar.png. I want foobar.png to be hosted on S3 and not each one of my EC2 servers though. How can I go about doing this?
Is there and configuration I can do in the AWS console or are there any rewrite rules I can use in Apache? I know I could always just set up a controller that will download the images from S3 and forward them to the user, but this seems wrong to me.
For that you need to put a load-balancer/proxy in front to intercept all requests and dispatch accordingly. That may not be a bad idea anyway (for availability reasons), but a separate host name for images should not be a problem, either (it's not like users will have to see or type those URL).
Using CloudFront, you can have CloudFront receive the initial requests, then based on the path, forward the request to either your EC2 instance or to your S3 bucket.
For example, you could setup the following:
A CloudFront behaviour that upon a path under /images/ would use an S3 origin, and
A default (for everything else) would go to your EC2 instance origin.

AWS: I can't link my route 53 configuration to my S3 bucket

I have 2 route53 hosted zone, let's call them myfirsturl.com and mysecondurl.com.
For both of them, I have created a bucket in S3 named after my domain names. I have verified it multiple times letter by letter.
Both of my buckets have static content, available from the S3 endpoint, with the fine policy etc: the 2 endpoints work perfectly.
The 1st hosted zone has been bought in route53 and when I connect to it, it opens my static website, all is good.
My second domain name has been transferred to Amazon last month, and in route 53 I can find the S3 bucket in the list of targets when I create the recordset, but it doesn't reach the static website
Another point: I have created a WP site a few days ago, behind a load balancer etc, and I linked wp.myfirsturl.com to it: it worked perfectly
I tried the same with wp.mysecondurl.com, to the same load balancer, it never worked.
I can't find any idea has I can't see any difference between my 2 domain name, except where I bought it.
Another difference:
The 1st is something like sometexte.info
The 2nd is something like sometext-othertext.fr
Maybe the hyphen is a problem? (it's not, pertaining to the doc)
Someone has a lead, please?
The bucket must have the same name as your domain or subdomain in Route53. For example, if you want to use the subdomain acme.example.com, the name of the bucket must be acme.example.com. Have a look at this documentation for more information.

MX record and Amazon S3

I'm having an issue with setting up my Google Apps account.
I believe that my S3 bucket is causing the problem.
I configure the MX records like Google asked me to and today mij DNS providers acknowledged that the records where propagated.
Now when I try to continue the setup of my Google Apps account it's stuck and doesn't provide any info. I have hosted a a static website on a Amazon S3 Bucket.
Trying to see if the MX records are available I used this tool MX Toolbox
to see if my MX records where available but they weren't. Anybody with the same problem or some professional advice?
BTW: the domain name is xntriek.be
What I suspect you will have to do is as follows:
1.) change the settings at your DNS registrar to use a different name server. For my registrar, namecheap, I go to manage -> transfer Name Server to 3rd party (or some variant) -> (leave this screen up - there should be a set of 5+ blank records)
2.) Set up Amazon Route 53.
3.) "Create Hosted Zone" for your domain name in the Route 53 console
4.) This hosted zone should be associated with a "Delegation Set" (right side of R53 console) - 4 records which you will paste into the screen you found in (1) above.
5.) Save that, and configure Route 53 as you would have configured records with your DNS provider. (CNAME aliasing and mx forwarding)
The reason this must be done in R53 and not at the Registrar is that setting the cname record alias to, say, www.yourdomain.com.aws.us-east.amazon blah blah blah tells mx traffic to go to amazon for instructions about what to do. Of course, there are no further instructions for that traffic if you have not set up Route 53.
I hope this helps!

Trouble setting up a subdomain on a VPS under Ubuntu and Apache

I'm a complete newbie when it comes to servers, so I need some help. Basically, I want to have a subdomain on my VPS. I'm not too concerned where the files reside, though of course I would like them separated if possible.
I found a guide to doing this that basically sums the procedure up in five steps:
Create directories to host the content of a new virtual site.
Make a copy of the /etc/apache2/sites-available/defaults file with a site appropriate name.
Change the two /var/www/ entries to the actual directory of the new site.
Add the ServerName line with the real domain name you will be hosting.
Use a2ensite to enable the new site, and finally reload Apache2 so it knows about the new site
I tried all of this, but I can't get it to work. I didn't get any errors at any point during this process, but when I enter the address with the subdomain into my browser, I get a "Server not found" error.
The company that hosts my VPS has an admin page where I can set up subdomains. Stupid question: do I have to do reconfigure the DNS records or something while doing this, or is it likely that the problem is caused by something else?
Additional note: I followed a guide on howtoforge.com when setting up the server, which in hindsight may not have been the brightest move on my part. It is possible that I made a mistake there that is somehow affecting me now?
Assuming you've setup the subdomain correctly in your VPS' admin page, the only thing left to check here is that you've actually created the subdomain in your DNS administration page (have you?). For example, I use afraid.org to manage my DNS records and to add a subdomain, it's essentially:
Type: A
Subdomain: sparky
Domain: example.com
Destination: 120.34.2.3 (this would be your VPS' IP address)
In general, you add a (sub)domain by:
sparky.example.com A 120.34.2.3
Please keep in mind that you want to add an A record (this is important!).