So I’ve successfully finished my first ruby app 🙂
When i programmed it locally, i have to use all the following commands below separately in terminal to get it up and running. The problem is when I close terminal they all stop, so I don’t know how to keep them open even when i log out of ssh on my server.
First I get the app running via rack (sinatra framework) on port 9292, then start redis, and then create a single worker for 2 Resque job queues
rackup config.ru
redis-server
rake workers:start
I haven’t been using “production/development” structures simply because I haven’t really learned about that yet. I’m just trying to get it set up simply, then I can go back and learn how all that works. So i understand this isnt the best method for a professional app, but right now I’m looking for the easiest (but still without taking shortcuts).
I also believe I’m going to be using passenger to get it officially running. I’m not sure what the next steps are to get it up and running so i can log out and it just stays active and working. I also dont know if i have to run the commands separately or if I can put them all in one file somewhere so i just run passenger start and thats the end of it.
If you’re going to use Passenger to host your application then you won’t be running commands to start the server; instead, the application will simply run as part of
nginxorhttpd, which will be started via the system’sinit(8)tool.How
init(8)is configured varies considerably from system to system, but SysV-styleinitwill typically have scripts in/etc/rc*.d/*directories to control startup, Upstart-based systems will have config files in/etc/init/, and so on. At that point, you’re not looking for ways to runpassengerapplications so much as a way to start Apachehttpdornginx, and that’s an already well-solved problem.