What should be the url in browser when starts a rails app in amazon EC2? - ruby-on-rails

I have created a rails app in Amazon EC2. After that I used
rails s
The server starts. But what should be the url to put in browser? I mean in browser, how can I view that app ? Please share with me if anyone have any idea on it.

You need to open port 3000 in amazon ec2. You will get option of adding rules, adding rule and opening port will do the job.
then
ip-address:3000 (will do job)

Got the solution. What I did is
run the server like this:
rails s -b ipaddress
And in browser: (Public DNS from amazon EC2:3000)
ec2-xx-xx-xx-xxx.us-west-2.compute.amazonaws.com:3000

Related

I can not open the url of the site deployed with dokku

Hello everybody) I started learning dokku. Going through the tutorial from the documentation for the Heroku Ruby on Rails "Getting Started" app I can't go to url generated by dokku in the browser. I am only using my local machine while learning and doing git push to localhost. This command works without errors, the container works, I get the url to the site, but I cannot open it in the browser. The same problem appears with another project, when I try to deploy a python django project, this is just a project skeleton created by django, without my code. It must show a welcome page and I want to see it when the site is running on dokku but I cannot go to the url. I tried to use dokku domains and dokku proxy but couldn't solve the problem. Please help me figure out how to fix this. I'm new to dokku, docker, nginx and deployment so the problem can be trivial. I'm also want to know on which ip, port dokku runs the sites and on which ip do I need to run the wsgi server inside the container?

run rails app with an ubuntu server with global ip

Currently, we are running our rails app, on AWS but we tried to move it to Heroku, which didn't work at all, now We are trying to run the app on Virtual Machine on hetzner. I can run the app on local server easily, my question is that, How can we run our rails app with a specific IP and then we can access that app anywhere in the world from that ip? is that possible to do so? We are using PUMA for server.
Yes, you can access to to your site with specific IP.
In description of hetzner Virtual Server says that server have 1 specific IP. So than you deployed and run you application y can access to app with 1.1.1.1:80 or another port.
If i understand you. Also what happened with heroku?

Connect to rails server remotely from raspberry pi

I have ssh'd into my rasberry pi and built a rails application.
Now how do I load the rails app from another machine?
I have tried IP:port in a web browser, but this fails.
Can I use ssh from a web browser to load the rails server process?
Are there gems I need to install to do this?
Is there any good documentation that I have missed?
SOLUTION
use ngrok to tunnel https://medium.com/#karimbutt/using-ngrok-to-create-a-publicly-accessible-web-facing-raspberry-pi-server-35deef8c816a#.sraso7zar
Maybe the problem is with the IP address you're trying to use. Servers don't necessarily forward their public IP traffic to localhost automatically.
Perhaps you could configure the IP address somehow, I don't know (others might?). Alternatively, you have a use a "local tunnel" service like ngrok or localtunnel. What these do is create a public URL for your localhost (i.e. your "loopback" address), so anyone can access it.
I spoke with a Ngrok author via email. He ensured me that I shouldn't need to expect any downtime from the service or to have to manually restart it. Although keep in mind that if you're on the free plan, whenever you restart Ngrok you're going to get a different URL. He also described it as kind of like a "souped up SSH -R"

How to Deploy Rails App to AWS

I am trying to host a Rails app in AWS cloud where I have an EC2 instance and apache and mysql . Here I have uploaded my app but I am unable to bind it with IP. For a testing I am using this blog post https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04 as a reference .
When I am trying to run this command :
RAILS_ENV=production rails server --binding=server_public_IP
I am getting this error :
/home/ubuntu/.rbenv/versions/2.2.3/lib/ruby/2.2.0/socket.rb:206:in `bind': Cannot assign requested address - bind(2) for 52.24.103.139:3000 (Errno::EADDRNOTAVAIL)
Is there anyone help me understand what is this problem and how to deploy it on AWS apache .
In AWS the machine is not directly assigned the IP, i.e. it is routed using NAT. hence you can not use the public IP to start your rails server directly.
To start server just boot it without the binding parameter rails s production
Or you can use 0.0.0.0 to bind your server, this will start your rails on all the interfaces.
Tip: For production you should ideally server using some web server like nginx/apache using passenger/unicorn
Looking from error it says it cannot bind with ipadd 52.24.103.139:3000
What I would suggest it to open a 'custom TCP port 3000' and try running the same thing again.
May be your app is working on port 3000 not 80.
Hope that helps.

Trying to run Redmine on Amazon EC2 with Bitnami- what to do after launching an instance?

So I followed these instructions here to install and run Redmine on EC2 using Bitnami.
I have now the instance running and I have a public DNS. However, I cannot still figure out how to access Redmine after this?
The other thing is I got the public key from Amazon when I signed up for the EC2 service, but so far nothing has asked me for the public key. When will that be used? Do I hvae to worry about it for running Redmine?
Im looking at the AWS console and my instance has a state of "running", everything is green. Yet when I place the public DNS in the browser and click go, the browser processes the request for a long time and eventually I get the message that "Google Chrome couldnot connect to the public DNS.
Im not sure what to do or where to look for help......
Any advice would be greatly appreciated
Did you follow step 4, which mentions that you need to open port 80 in your security group? If not, it is likely the default settings are likely blocking access to the web server.

Resources