Wednesday, May 14, 2014

Temporarily Run Staging Server

Run Staging Version of Web App

Sometimes, you may want to temporarily run a staging version of your web application for testing purposes.

Here's a simple hack that you may consider using in order to test your web application.

Go to root path where the staging version of the application is located.

Assuming you have deployed the development environment version of a rails application and wish to run it on port 8080, preface the server start command with nohup and append an ampersand &.

This will ensure that even when you close the terminal where you executed those commands that the staging server will continue to run...until you kill it.

$ cd /opt/webapps/staging

$ nohup bundle exec thin start -p 8080 -e development &


Stop Staging Version of Web App


$ kill -9 `ps -ef|grep ruby|grep 8080|awk '{print $2}'`

Notes

Your staging server will continue to run until you kill it or your server reboots.

No comments:

Post a Comment