0

It's really difficult to explain. But basically, I have an amazon instance, and I want to ssh into it and run a local server on it with sinatra. so I would ssh into the amazon instance, git clone my repo, and run ruby config.ru. Then I want someone else to be able to see that exact local server that is being ran. One of the things I've done is added a security group, port 4567 HTTP so that I can access it via public dns. It works on a rack app but it doesn't work on the sinatra, I've even tried a 'hello world' sample app to try to get it working.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
TakaGoto
  • 362
  • 4
  • 17
  • Have you installed the Bundler gem? – ian Jul 08 '13 at 22:53
  • of course, the main problem is I cant access the running local server from a different computer – TakaGoto Jul 09 '13 at 14:20
  • OK, just checking. Have you seen [this question](http://stackoverflow.com/q/4821466/335847)? – ian Jul 09 '13 at 18:00
  • yes, and to fix my post, I don't have to put it on port 80, any port is fine as long as add the rule to the amazon instance. I pretty much haven't done anything different with the sinatra app as it's working completely find on a local server. – TakaGoto Jul 11 '13 at 15:51
  • 1
    Are you using the Sinatra built in server (e.g. runnig `ruby myapp.rb`)? If so are you running in the default `development` environment or are you running in `production`? – matt Jul 13 '13 at 14:15

1 Answers1

3

I'm not sure if there is a specific reason that you want to do this from an Amazon server or not, but if you just want someone else to see your sinatra app, you could simply use localtunnel.

Using this, you can simply run localhost on your OWN computer, then run localtunnel PORTNUMBER and it will give you a URL that your app will now be visible from. You can then give that URL to anyone you want.

Example of use:

$ ruby myapp.rb

$ localtunnel 4567

A URL will then be displayed for you to copy-paste to a friend. Easy as that.

I use this a lot when developing web apps to be mobile friendly and want to quickly look at the app on my phone without having to deploy to a server.

seanholden
  • 111
  • 4
  • perfect, yea that was what I needed. also for some reason on my config.ru I can't do 'Sinatra::Application.run!', I have to just leave it as 'Sinatra::Application' and it ran. thanks – TakaGoto Jul 16 '13 at 18:50