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

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

是否有可能使用Apache和mod_rails(Phusion Passenger)在共享主机环境(如Dreamhost)中运行它?

创build文件“config.ru”,添加到它:

require "gollum/frontend/app" Precious::App.set(:gollum_path, File.dirname(__FILE__)) Precious::App.set(:wiki_options, {}) run Precious::App 

有一个很好的指导:

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

要点是:

  • 添加一个config.ru到lib / gollum / frontend
  • 将您的文档根目录指向lib / gollum / frontend / public
  • 使用下面的config.ru作为基础,相应地设置wikipath(我必须添加打包器设置部分)
 #!/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 

August Lilleaas的答案是正确的,但是我需要使用旧版本的gollum,所以我使用Bundler进行设置:

Gemfile

 source 'http://rubygems.org' gem 'rdiscount' gem 'gollum', '1.3.0' 

config.ru

 require 'rubygems' require 'bundler' Bundler.require require "gollum/frontend/app" Precious::App.set(:gollum_path, File.expand_path(File.dirname(__FILE__))) Precious::App.set(:wiki_options, {}) run Precious::App 

还要记住创build目录publictmp ,因为Passenger需要这些。

但是,我遇到了另一个问题。 你必须确保git位于web服务器用户的path中。 对我来说,情况并非如此,不幸的是,没有任何错误消息,你只是总是在页面上创build一个新的页面。