如何在共享主机环境(例如 Dreamhost)中使用 mod_rails 和 Apache 运行 Gollum?

Ken*_*ers 10 linux ruby phusion-passenger apache-2.2

Gollum是 GitHub 用 Ruby 编写的新 wiki 引擎。在本地部署它使用 Sinatra 实例来提供 Web 界面。

是否可以使用 Apache 和 mod_rails(Phusion Passenger)在诸如 Dreamhost 之类的共享托管环境中运行它?

小智 7

有一个很好的指南:

https://github.com/tecnh/gollum/wiki/Gollum-and-Passenger

要点是:

  • 将 config.ru 添加到 lib/gollum/frontend
  • 将您的文档根目录指向 lib/gollum/frontend/public
  • 使用以下 config.ru 作为基础,相应地设置 wiki 路径(我必须添加捆绑程序设置部分)
#!/usr/bin/ruby
require 'rubygems'
require 'bundler/setup'
require 'gollum/frontend/app'

system("which git") or raise "Looks like I can't find the git CLI in your path.\nYour path is: #{ENV['PATH']}"

gollum_path = '/path/to/wiki' # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO

disable :run

configure :development, :staging, :production do
 set :raise_errors, true
 set :show_exceptions, true
 set :dump_errors, true
 set :clean_trace, true
end

$path = gollum_path
Precious::App.set(:gollum_path, gollum_path)
Precious::App.set(:wiki_options, {})

run Precious::App
Run Code Online (Sandbox Code Playgroud)


小智 5

创建文件“config.ru”,将其添加到其中:

require "gollum/frontend/app"

Precious::App.set(:gollum_path, File.dirname(__FILE__))
Precious::App.set(:wiki_options, {})
run Precious::App
Run Code Online (Sandbox Code Playgroud)