Back

thin + rackup + yml的启动方式 ( thin + config.ru + thin.yml )

发布时间: 2014-05-26 00:51:00

对于ruby-cas, 我们目前使用的方式是  thin + config.ru :  ( currently , we are using ruby-cas (rack) + thin )

当前的启动方式是: (已经存在的config.ru 文件如下 )  ( current start command is as below: )

$ bundle exec thin start -R config.ru -p 3535 -e production -d

  # config.ru
require 'rubygems'
require 'bundler/setup'

$:.unshift "#{File.dirname(__FILE__)}/lib"
require "casserver"

use Rack::ShowExceptions
use Rack::Runtime
use Rack::CommonLogger

run CASServer::Server.new

1. 命令行:   ( so , this is the command line ) 

$ bundle exec thin start -R config.ru -p 3535 -e production -d

2. 如果要启动多个服务器呢? (启动3535, 3536 两个端口)  ( this is how to start multiple servers in one command) 

$ bundle exec thin start -R config.ru -p 3535 -e production -d -s 2

3. 使用 config.yml 的方式: $ bundle exec thin start -C thin.yml   ( start servers using config.yml file) 

---
chdir: /opt/app/ruby/m-cas
environment: production
address: 0.0.0.0
port: 3501
timeout: 30
log: log/thin.log
pid: tmp/pids/thin.pid
rackup: config.ru    # < ==  NOTICE this. 
max_conns: 1024
max_persistent_conns: 512 
require: []
wait: 5
servers: 8
daemonize: true

Back