我用 Sinatra 编写了一个小型应用程序。
现在,在该项目的根目录中,我运行“thin start”,它起作用了。这只是一个小项目,只能在我的本地计算机上运行。所以我不需要使用 Nginx,我打算只使用“thin”。
嗯,应用程序应该在服务器启动时自动运行。我怎样才能做到这一点?
我已经跑了:
sudo thin install
sudo update-rc.d -f thin defaults
看起来 Thin 可以自动运行但是,我可以在哪里配置它来运行我的应用程序?
呃...也许这个问题与 sinatra 或 Thin 无关。我只需要机器启动时自动运行的东西。我对Linux不熟悉o(////)o
最佳答案
据我所知,您需要将配置文件放入/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
关于ruby - 如何仅使用thin部署sinatra应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14056477/