如何使用thin来部署sinatra应用程序?

时间:2012-12-27 14:44:29

标签: ruby linux deployment sinatra thin

我和Sinatra一起写了一个小应用程序。

现在,在这个项目的根目录中,我运行“瘦启动”,它可以工作。这只是一个小项目,只能在我的本地机器上运行。所以我不需要使用Nginx,我只打算使用“瘦”。

嗯,applcation应该在服务器启动时自动运行。我怎么能做到这一点?

我跑了:

sudo thin install
sudo update-rc.d -f thin defaults

似乎瘦可以自动运行但是,我可以在哪里配置它来运行我的应用程序?

呃......也许这个问题与sinatra或瘦身无关。我只需要在机器启动时自动运行的东西。我不熟悉Linux o(////)o

1 个答案:

答案 0 :(得分:2)

据我所知,您需要将配置文件放入/ etc / thin / 我想你可以在/etc/thin/thin.yml

中找到例子
--- 
user: www-data
group: www-data
pid: tmp/pids/thin.pid
timeout: 30
wait: 30
log: log/thin.log
max_conns: 1024
require: []
environment: production
max_persistent_conns: 512
servers: 1
threaded: true
no-epoll: true
daemonize: true
socket: tmp/sockets/thin.sock
chdir: /path/to/your/apps/root
tag: a-name-to-show-up-in-ps aux