Deploying rails application bitnami rubystack GoDaddy

91 Views Asked by At

I am new to using stacks such as those from Bitnami. I recently created a Bitnami RubyStack on GoDaddy, cloned my repository and did all the house cleaning. When i SSH into the server and run rails s -b MY_PUBLIC_ip -p PORT in the application directory and i open the browser, it works perfectly fine but when i close the SSH session and point to the same address there is nothing. The public IP still shows the welcome page. I think i misunderstood the whole concept. Can someone please help teach me how it is done. Thanks in advance.

Update I heard something about creating virtual hosts but cant understand how the rails s command will run. Is it possible to start the server and it continues running even when the SSH session is closed.

2

There are 2 best solutions below

0
On

That's completely fine (using Linux to connect via SSH, the principle remains the same), I think you misunderstand what Screen actually does (might be my explanation of it). You can still connect normally via SSH. So let's say ssh name@ip. After installing screen with: apt-get install screen you can type screen (within your SSH session). After this type the command to start the server like you normally would: rails s -b MY_PUBLIC_ip -p PORT. Now type: ctrl + a and after d (detach but keep shell window open). Now you can kill the SSH connection and the server is still alive. If you want to re-open the server again via the SSH connection you use screen -r to open the last session(the one you just started)

0
On

Instead of using rails to deploy your application and screen to keep it running once you close the SSH connection, you can consider the next alternative:

Bitnami Rubystack includes apache and nginx servers installed as a service so as long as your instance is running, these servers (one or another) will be running too. You can configure on of those web servers to deploy your application and it will be ready for production. You can see how to configure these web servers in this link