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


10

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

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

Answers:


5

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

require "gollum/frontend/app"

Precious::App.set(:gollum_path, File.dirname(__FILE__))
Precious::App.set(:wiki_options, {})
run Precious::App

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

1

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

还记得创建目录publictmp,因为Passenger需要这些目录。

但是,我遇到了另一个问题。您必须确保git该路径在webserver-user的路径中。对我来说不是这种情况,不幸的是没有错误消息,您总是总是在页面上最终创建一个新页面。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.