Reputation: 417
I'm trying to deploy a Meteor app using mup and an AWS EC2 micro instance.
I've followed the whole tutorial here http://www.curtismlarson.com/blog/2015/11/03/deploy-meteor-to-aws/, successfully running mup deploy
.
However when I go to the instance's Public IP on google chrome or firefox, it simply says:
myapp.com took too long to respond.
If anyone could tell me how I can find the source of this problem, I'd be extremely grateful!
Here's my mup.json
:
{
// Server authentication info
"servers": [
{
"host": "52.***.***.***",
"username": "ubuntu",
"pem": "~/************.pem"
}
],
// Install MongoDB in the server, does not destroy local MongoDB on future setup
"setupMongo": true,
// WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
"setupNode": true,
// WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number.
"nodeVersion": "0.10.41",
// Install PhantomJS in the server
"setupPhantom": true,
// Show a progress bar during the upload of the bundle to the server.
// Might cause an error in some rare cases if set to true, for instance in Shippable CI
"enableUploadProgressBar": true,
// Application name (No spaces)
"appName": "menus",
// Location of app (local directory)
"app": "~/menus",
// Configure environment
"env": {
"ROOT_URL": "http://myapp.com"
},
// Meteor Up checks if the app comes online just after the deployment
// before mup checks that, it will wait for no. of seconds configured below
"deployCheckWaitTime": 15
}
The "ROOT_URL": "http://myapp.com"
line is exactly how it appears in the file ( I didn't know what else to choose).
Edit: Here's the /opt/menus/config/env.sh
file:
#!/bin/bash
export PORT=80
export MONGO_URL=mongodb://127.0.0.1/menus
export ROOT_URL=http://localhost
#it is possible to override above env-vars from the user-provided values
export PORT=\8\0
export ROOT_URL=\h\t\t\p\:\/\/\m\y\a\p\p\.\c\o\m
export METEOR_SETTINGS=\{\"\p\u\b\l\i\c\"\:\{\}\}
export CLUSTER_ENDPOINT_URL=\h\t\t\p\:\/\/\5\2\.\2\0\1\.\2\1\2\.\1\4\2\:\8\0
Those escapes definitely look out of place, but I feel like 1 wrong stroke could leave it still crashing! The fact that ROOT_URL
is defined twice is concerning me. How exactly should I proceed?
Upvotes: 2
Views: 260
Reputation: 21374
For me mup
still has a bug where the file /opt/myapp/config/env.sh
generated by mup
was incorrectly formatted (there were some extra spaces and extra escapes). You may want to check that, i.e., ssh into your instance and look at that file. If you need to fix it, do so, and then run mup restart
from your development machine.
The second hypothesis I have is that mup
doesn't interpret ~
. So you may want to try using the resolved path for app
, or just the relative path from where your mup.json lives.
Update:
As expected, the env.sh file is wrong (bug in mup). Try this:
#!/bin/bash
export PORT=80
export MONGO_URL=mongodb://127.0.0.1/menus
export ROOT_URL=http://localhost
#it is possible to override above env-vars from the user-provided values
export PORT=80
export ROOT_URL="http://myapp.com"
export METEOR_SETTINGS="{\"public\":{}}"
export CLUSTER_ENDPOINT_URL="http://52.201.212.142:80"
Upvotes: 1