简体   繁体   中英

How can i keep retaining the Amazon EC2 server

This is my step

  1. Made a new instance in Amazon EC2

  2. connect to the ec2 instance with ssh client

  3. git cloned a Ruby on Rails app

  4. run the server with rails s

  5. try to connect to the url : EC2PUBLICIP:3000

  6. ok it works!

  7. closed the ssh client terminal

  8. 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM