Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have my js files which I have uploaded into the Amazon S3 and linked it with the Cloudfront.

I got a url something like this :

dxxxxxxxx.cloudfront.net

But opening that url in my browser ( I'm getting an error ) :

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>xxxxxx</RequestId>
<HostId>
xxxxxxxxxxxxxxx
</HostId>
</Error>

But what I want actually is to use the url and add them to my webpage. How could I do that?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You need to set the ACLs on your S3 objects so that they're world readable. By default they're not.

share|improve this answer
    
Thanks that works, the access denied error went off. Now it shows only the xml file. But what I want to show is the js that I uploaded into my s3 bucket. –  sriram Oct 11 '12 at 11:00
    
The URL you've pasted above doesn't contain a path to the actual .js file. Find the full path of your .js file and add it to the end of your dxxxxxxxx.cloudfront.net name. For example: http://dxxxxxxxx.cloudfront.net/my.js –  Alastair McCormack Oct 11 '12 at 11:32
    
Thanks that works! –  sriram Oct 11 '12 at 11:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.