Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor.js deploy to "example.com" or "www.example.com"?

I recently deployed a meteor app using the following command:

$ meteor deploy example.com 

and later (thinking that it was the same) using the following:

$ meteor deploy www.example.com 

It end up serving two different versions of the app, one hosted in "example.com" and other hosted in "www.example.com".

Can I revert one of the deploys? Which one should I revert?

If not, what kind of configs should I set on my domain provider?

Thank you, Joao

like image 426
jdscosta91 Avatar asked Mar 29 '13 13:03

jdscosta91


2 Answers

When people go to your page, do you want them to see mydomain.com or www.mydomain.com?

If it's mydomain.com, then you want to set your DNS zone file with an A record for the domain that points to the IP of origin.meteor.com

If it's www.mydomain.com, then you want to set your DNS zone file with a CNAME for the subdomain "www" that points to origin.meteor.com

Then, you want to set "domain forwarding" from one of those choices to the other. For example, I've set up http://playlistparty.net to forward to http://www.playlistparty.net.

After this, you just run:

meteor deploy www.playlistparty.net 


You can delete the deployment you won't be using with the --delete option.

meteor deploy www.playlistparty.net --delete 
like image 114
travellingprog Avatar answered Sep 21 '22 04:09

travellingprog


Deploying on a custom domain name

Deploy meteor to your domain name:

meteor deploy mydomain.com 

Set your CNAME record for *.mydomain.com or www.mydomain.com (if you only want to set the www subdomain) and mydomain.com to : origin.meteor.com

OR

point your 'A' record for *.mydomain.com and mydomain.com to : 107.22.210.133.

To remove an exising one you might have typed by accident:

meteor deploy www.mydomain.com --delete 
like image 38
Tarang Avatar answered Sep 20 '22 04:09

Tarang