Deprecated: Function split() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/lib/func.php on line 75
Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/plugin/ref.inc.php on line 207
まずはbundle installまで
プロジェクトのdirを適当につくってGemfileを作成。あとgit initもしとこう。
$ mkdir gollum $ bundle init $ git init
Gemfileを編集。
# A sample Gemfile source "https://rubygems.org" gem 'gollum' # formats gem 'redcarpet' gem 'github-markdown' gem 'wikicloth' # capistranoとか group :development do gem 'capistrano' gem 'capistrano-ext' end
bundle installする
bundle install --path vendor/bundle
あ、そうそう、.gitignoreも適当につくっときましょう。
/.bundle /vendor/bundle
とりあえずlocalでrackupできるとこまで。
config.ruをふわっと書く
#!/usr/bin/env ruby require 'rubygems' require 'gollum' require 'gollum/frontend/app' use Rack::ShowExceptions Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES Gollum::Page::FORMAT_NAMES = { :markdown => "Markdown", :mediawiki => "MediaWiki" } Precious::App.set(:gollum_path, repos_path) Precious::App.set(:default_markup, :markdown) Precious::App.set(:wiki_options, {universal_toc: true}) run Precious::App
rackup (ッターン!
$ bundle exec rackup [2012-12-21 19:36:14] INFO WEBrick 1.3.1 [2012-12-21 19:36:14] INFO ruby 1.9.3 (2012-11-10) [x86_64-darwin11.4.2] [2012-12-21 19:36:14] INFO WEBrick::HTTPServer#start: pid=22609 port=9292
"localhost:9292"で確認できたよー。わーい。
よし。capistranoでdeployするぞう。
このままcap deployする方向ですすめるとdeployするたびにwikiのデータがぶっ飛ぶというダメwikiになってしまうので、wikiのデータ用のレポジトリは分けましょうそうしましょう。
config.ruで別レポジトリがなければ作る的な処理を追加。
#!/usr/bin/env ruby require 'rubygems' require 'gollum' require 'gollum/frontend/app' use Rack::ShowExceptions # reposがなければ作ればいいじゃない repos_path = File.join(Dir.pwd, 'wiki.git') unless File.exists? repos_path Dir::mkdir(repos_path) end unless File.exists? File.join(repos_path, '.git') Grit::Repo.init(repos_path) end Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES Gollum::Page::FORMAT_NAMES = { :markdown => "Markdown", :mediawiki => "MediaWiki" } Precious::App.set(:gollum_path, repos_path) Precious::App.set(:default_markup, :markdown) Precious::App.set(:wiki_options, {universal_toc: true}) run Precious::App
.gitignoreもちょっと修正
/.bundle /vendor/bundle /wiki.git /public
んで、"capify ."して編集するなり、ゼロから書くなりでconfig/deploy.rbを用意。
#encoding: utf-8 # capistrano-ext require "capistrano/ext/multistage" # bundler require "bundler/capistrano" set :bundle_flags, "--deployment" #################################################### # Application #################################################### set :application, "gollum" set :keep_releases, 5 # releasesに残すverの数 #################################################### # Deploy user #################################################### set :use_sudo, false default_run_options[:pty] = true ##################################################### # Git ##################################################### set :scm, :git set :scm_verbose, true set :repository, "git+ssh://path/to/hoge.git" #################################################### # Task #################################################### namespace :deploy do after 'deploy:setup' do sudo "chmod -R o+w #{deploy_to}" run "mkdir -m 777 #{shared_path}/wiki.git" end after 'deploy:create_symlink' do run <<-CMD cd #{release_path}; rm -fr #{release_path}/public && ln -nfs `bundle show gollum`/lib/gollum/frontend/public/gollum #{release_path}/public CMD run <<-CMD rm -fr #{release_path}/wiki.git && ln -nfs #{shared_path}/wiki.git #{release_path}/wiki.git CMD end task :start, :roles => :app do run "touch #{current_release}/tmp/restart.txt" end task :stop, :roles => :app do end desc "Restart Application" task :restart, :roles => :app do run "touch #{current_release}/tmp/restart.txt" end # restart後にcleanup after "deploy:start", "deploy:cleanup" after "deploy:restart", "deploy:cleanup" end
特に必要性ないけどいつものかんじでcapistrano-ext使ってるのでconfig/deploy/**.rbもつくる。とりあえず今回はproduction.rbにするべ。
#encoding: utf-8 #################################################### # Application #################################################### set :deploy_to, "/path/to/dir" #deploy先 set :rails_env, 'production' # いらんかも ##################################################### # Servers ###################################################### server 'hoge.net', :web, :app role :db, "#{roles[:app].first}", :primary => true ##################################################### # Git ##################################################### set :branch, 'master'
で、ひとまずdeployはまだ置いておいてサーバのほうの設定しましょう
apacheとpassengerをすでに入ってるってことでインスコとかの説明割愛。
apacheの設定にごにょごにょ追加。
<VirtualHost *:80> ServerName wiki.hoge.net ErrorLog logs/wiki_error_log CustomLog logs/wiki_access_log combined DocumentRoot /path/to/dir/gollum/current/public <Directory "/path/to/dir/gollum/current/public"> Options FollowSymLinks -Includes -ExecCGI -Indexes -MultiViews AllowOverride All Order allow,deny Allow from all </Directory> RackBaseURI / RailsEnv production </VirtualHost>
んでapache再起動
$ sudo apachectl restart
よっしゃーdeployだー
初回だけまずは必要なdirやらfile作成
$ bundle exec cap production deploy:setup
問題なくsetup完了したらコードをポポポポーン。
あ、もちろんココまでに適宜gitにcommitはしててremoteにpushまで済んでるってことで。
$ bundle exec cap production deploy
わーい。できたよー。
Prev / Next in same category
Comment Form
Trackbacks (1)
gregory グレゴリー ハードテイル
gollum(githubのwikiエンジン)をサーバ (apache + passenger)で動かしたよメモ。 | おれせか
Comments (14)
十年前、あなたはあなたが他の誰かが重要ではないと昨日も、アール年前誰が、重要なのは、あなたが誰であるか、誰であり、あなたがなる明日、。
私はあなたの記事を見てとても幸せです。
自責の念が重要例示預金をもたらし
Perfectly indited subject material, thank you for information. “In the fight between you and the world, back the world.” by Frank Zappa.
jack wills outlet http://spicesassociation.com/jackwillsoutlet.html
My husband and i were thrilled when Ervin could deal with his basic research out of the ideas he was given through the site. It is now and again perplexing to simply always be freely giving tactics that some others could have been trying to sell. And we all keep in mind we have got the blog owner to thank for that. All the illustrations you’ve made, the straightforward site navigation, the friendships your site make it possible to instill - it is all excellent, and it is letting our son and the family recognize that this theme is satisfying, which is truly vital. Many thanks for all!
プロジェクトのdirを適当につくってGemfileを作成。あとgit initもしとこう。
赤くて緑の色合わせシャネル激安は自動的に鎖の腕時計に行って1人似通って見聞、
サンタクロースに富を極めて、
シャネル激安http://www.cctoh.com/
最も敬虔な祝福を使って祝いの贈り物をします楽しいクリスマスの時間。
シャネル眼鏡
シャネル腕時計
シャネルピアス
シャネル財布
シャネル靴
シャネルバッグ
シリーズの腕時計は皆賭博の世界の濃厚な息を含んで、
シャネルの時計の文字盤設計の格調をまねるのが鮮明で、
モナコ観光名所の蒙特ka羅の独特な個性を反映します。
It is now and again perplexing to simply always be freely giving tactics that some others could have been trying to sell.
bundle exec rails g migration add_max_attempts_to_delayed_jobs max_attempts:integer
It is now and again perplexing to simply always be freely giving tactics that some others could have been trying to sell.
アイブ氏は前に自分のものを読んで、あなたはあまりにも素晴らしい。
動かしたよメモ。
, if the mind is too long directed Training Pas Cher to one object Cheap New Balance 997.5 Shoes only, Training Pas Cher it will get stiff and rigid, and unable to take in many interests,’ said Margaret.‘I do not quite understand what you mean by a mind getting stiff and rigid. Nor do I admire tho Cheap Jordan 18 Shoes se whirligig characters that are full of this thin
lls were Zapatillas Nike Zoom Hyperchaos close Maillot Suède Pas Cher d. I hardly know whether it will interest any one to learn that something under half a million yards of calico are here printed annually. At the Lowell Bleachery fifteen million yards are dyed annually. Maillot Algérie Pas Cher The Merrimack Cotton Mills were stopped, and so had the other mills at Lowell been