Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control where Meteor runs

I'm installing Meteor (framework) on my AWS EC2 (micro) instance and followed the instructions and after creating a test project I ran meteor on that directory giving me the expected

[[[[[ /var/www/html/meteortest ]]]]]

Running on: http://localhost:3000/

But I can't navigate to my server's localhost in my browser to see the hello world example project. Is there a way I can make meteor work on something like :

http://mydomain.com/meteortest/

or

http://mydomain.com/meteortest:3000
like image 374
Kevin Beal Avatar asked Dec 02 '12 02:12

Kevin Beal


1 Answers

The way that Meteor sets the ROOT URL is by using an environment variable called ROOT_URL:

http://docs.meteor.com/#meteor_absoluteurl

So you could run your Meteor instance like so: ROOT_URL="http://mydomain.com/" meteor --port 80

However, if you want to have the meteor instance served from a folder (like http://mydomain.com/meteortest), you will have to use nginx to forward ports (see Tyr's example) but replace the line:

location / {

with:

location /meteortest {

and change your ROOT_URL appropriately. If you still can't access your domain from outside, you may have not set your security groups properly for EC2. You have to open up port 80. More information on how to do this can be here: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using-network-security.html

like image 172
HGandhi Avatar answered Nov 10 '22 06:11

HGandhi