This is my step
Made a new instance in Amazon EC2
connect to the ec2 instance with ssh client
git cloned a Ruby on Rails app
run the server with rails s
try to connect to the url : EC2PUBLICIP:3000
ok it works!
closed the ssh client terminal
now i cannot connect :(
Do I have to keep retaining the ssh client from my local pc to run the instance server????
Try this
rails server &
This will run the server in the background, so it will not be stopped when the ssh connection is closed
For a process to continue after you close the console you need to use nohup
nohup rails server &
But note that if your machine is restarted, there is nothing to start your server automatically. For better production-ready application, look at solutions like the ones mentioned here: Ruby on Rails Server options
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.