Giter Club home page Giter Club logo

ec2-webapp's People

Contributors

rsms avatar ryanseddon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ec2-webapp's Issues

ssh-keygen doesn't work with -Hu www-data

First let me say, big thanks for this project. Although I didn't use much of the move stuff, it's the perfect tutorial to get a node app on EC2 up and running!

I only noticed, that when generating a key in behalf of www-data $ sudo git pull doesn't seams to work. The key can't be found, since ssh looking in /root/.ssh/ for the key.

When just doing sudo ssh-keygen -t rsa everything is fine.

Or did I miss something?

Bad Gateway Revisited

I have followed your suggestions from a previous post (to restart, then check for a connection on Port 3000).
I suspect the move script may not actually be executing; after adding a few print statements, no visible results. Can you suggest a debug approach?

sudo invoke-rc.d myapp-httpd restart

  • stopping myapp-httpd [ OK ]
  • starting myapp-httpd [ OK ]

curl 127.0.0.1:3000

curl: (7) couldn't connect to host

SSH Agent Forwarding

Not an issue as much as a (few) comments...

First, thank you for your efforts. I have a similar "recipe" but did not have the forethought to share via GIT - my only-child mentality prevents me from sharing.

A few thoughts/additions...

  1. Copying your public key to the EC2 instance will make it easier to repetitively login to the remote host without the need to pass keys via the command line.
  2. By using SSH Agent Forwarding you can effectively skip the "Checkout your source - If your git repository is private:" step and avoid the need to configure deploy keys. Agent forwarding is disabled on OSX but can easily be enabled...

edit /etc/ssh_config
uncomment Host *
uncomment ForwardAgent
change ForwardAgent no TO ForwardAgent yes

Thanks again

Running bin/myapp-httpd.mv throws error

Attempting to run a local build using node v0.6.5+ throws and error

node bin/myapp-httpd.mv 

/you/myapp/bin/performance-httpd.mv:2
require.paths.unshift __dirname+'/../nodelib'
                      ^^^^^^^^^
node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick

It appears there may be simular issue as noted here:
bnoguchi/everyauth#109

Issues with symbolic link

Thanks for this write, i got it through to the step of creating a symbolic link here:

ubuntu$ sudo ln -s /var/myapp/init.d/myapp-httpd /etc/init.d/

my first run through i got this error:
update-rc.d: /etc/init.d/myapp-httpd: file does not exist

so i figured i should make the directory structure in the ln command so:

ubuntu$ sudo mkdir /var/myapp/init.d/myapp-httpd

then again:
ubuntu$ sudo ln -s /var/myapp/init.d/myapp-httpd /etc/init.d/
ln: creating symbolic link `/etc/init.d/myapp-httpd': File exists

but then when i run the update-rc.d command i get this:

ubuntu$ sudo update-rc.d myapp-httpd defaults
update-rc.d: /etc/init.d/myapp-httpd: file does not exist

is there a step i'm missing? should I not be creating the init.d/myapp-httpd folder?

502 Bad Gateway

First of all, thank you for putting this together. I feel like I'm close and I wouldn't be if not for this guide.

I've followed all the steps on install.md. At the end I try to curl http://127.0.0.1 and I get:

502 Bad Gateway


nginx/0.7.67

I also don't see anything set up on port 3000.
(curl: (7) couldn't connect to host)

I tried adding the sample node.js from the node.js site to a file in nodelib called ws.js:

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');

But nothing come sup on port 8124 either.

I really don't know what I'm doing and I've learned a ton from executing the guide. As best I can tell, I've started both the myapp-httpd and myapp-processor(and maybe this is my mistake, it said optional and optionally so I did both). Any help would be greatly appreciated.

Windows SSH

Since SSH isn't built into Windows (Boo!) it involves a few more steps to SSH into an EC2 instance. I could write a step by step guide that shows how to do it with putty/putty gen etc.

I'd make it a separate markdown document and just link to it in the INSTALL.md file.

Let me know and I'll update my fork and do a pull request.

Instructions clarification

Great work, thanks. I'm playing around with this to evaluate it for CI for my AWS apps, including modifying it for use with Tornado in place of Node.

However, I'm new to Node and am a little unclear on the directory structure here. In the Install.md instructions it's not quite clear what directory we're working from: ~, /var/www, /var/myapp, /var/ec2-webapp?

What should the final directory structure look like?

/var/www/
/var/www/src/node
/var/ec2-webapp/
/var/myapp/

Edit: or now that I've played around with it more, should it be:

/var/ec2-webapp/
/var/ec2-webapp/src/node
/var/ec2-webapp/src/myapp

Or something else?

Thanks!

Workflow 1 server documentation issue

Im a bit of a n00b so maybe I'm missing something.

When attempting to run through the workflow 1 an error message displayed when remotely restarting the services

cd src/myapp
git commit ...
ssh -i ~/.ssh/myapp.pem [email protected]:/var/myapp/update restart
# ssh: Could not resolve hostname myapp:/var/myapp/update: nodename nor servname provided, or not known

Changing the SSH command to the following worked for me.

cd src/myapp
git commit ...
git push origin master
ssh -i ~/.ssh/myapp.pem ubuntu@myapp '/var/performance/update restart' 
# some stats ...

I think adding a simple post commit hook to execute the update restart on my local makes this brain dead simple.

Thanks so much for this excellent project!

connect version mismatch

Hi, I was just following your instructions blindly

ubuntu@ip-10-88-163-66:~/node/src$ sudo npm install connect connect_json move
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: [email protected]
npm ERR! Required: {"node":">= 0.4.1 < 0.5.0"}
npm ERR! Actual: {"npm":"1.0.22","node":"v0.5.3-pre"}
npm ERR!
npm ERR! System Linux 2.6.35-24-virtual
npm ERR! command "node" "/usr/local/bin/npm" "install" "connect" "connect_json"
"move"
npm ERR! cwd /home/ubuntu/node/src
npm ERR! node -v v0.5.3-pre
npm ERR! npm -v 1.0.22
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/node/src/npm-debug.log
npm not ok

nginx should handle HTTP 403 to the backend, too

/etc/nginx/sites-available/myapp-httpp

currently is:

location / {
root        /var/myapp/public;
index       index.html;
error_page  404 = @backend;
}

should:

location / {
root        /var/myapp/public;
index       index.html;
error_page  404 = @backend;
error_page  403 = @backend;
}

otherwise it is not possible return something from node.js on the root (i.e.: http://www.myapp.com/) of the domain, as nginx (if the 'public' folder exists) needs to handle an HTTP 403 instead of an HTTP 404.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.