Skip to content

Instantly share code, notes, and snippets.

@xluffy
Last active August 29, 2015 14:11
Show Gist options
  • Save xluffy/9cb30cd087a9a9661455 to your computer and use it in GitHub Desktop.
Save xluffy/9cb30cd087a9a9661455 to your computer and use it in GitHub Desktop.
Install Gitit on Ubuntu 12.04 server

Env

Môi trường: Ubuntu 12.04 server, x86_64

Service: Gitit (haskell)

Mirror

Mirror FPT

~$ sudo sed -i 's/vn.archive.ubuntu.com/mirror-fpt-telecom.fpt.net/g' /etc/apt/sources.list
~$ sudo apt-get update

Lib

Cài đặt một số thư viện

~$ sudo apt-get install git cabal-install libghc-zlib-dev
~$ sudo apt-get install libgmp3c2 freeglut3 libedit2 libedit-dev freeglut3-dev \
libglu1-mesa-dev

~$ sudo apt-get install libghc-pandoc-dev libghc-pandoc-doc libghc-pandoc-types-dev \
libghc-pandoc-types-doc libghc-pandoc-types-prof

Gitit

~$ cabal update
~$ cabal install gitit

Lỗi khi cài đặt gitit, lỗi này là do không cài đặt được pandoc, 1 gói phụ thuộc của gitit, ta sẽ biên dịch pandoc

Downloading pandoc-1.13.1...
[1 of 1] Compiling Main             ( /tmp/pandoc-1.13.1-18654/pandoc-1.13.1/Setup.hs, /tmp/pandoc-1.13.1-18654/pandoc-1.13.1/dist/setup/Main.o )
Linking /tmp/pandoc-1.13.1-18654/pandoc-1.13.1/dist/setup/setup ...
Configuring pandoc-1.13.1...
setup: At least the following dependencies are missing:
http-client >=0.3.2 && <0.4 && ==0.4.6
cabal: Error: some packages failed to install:
gitit-0.10.6.1 depends on pandoc-1.13.1 which failed to install.
pandoc-1.13.1 failed during the configure step. The exception was:
ExitFailure 1

pandoc

~$ wget -O pandoc-1.13.1.tgz https://github.com/jgm/pandoc/archive/1.13.1.tar.gz
~$ wget -O pandoc-templates.tgz https://github.com/jgm/pandoc-templates/archive/1.13.1.tar.gz
-> giải nén vào thư mục pandoc-1.13.1/data/templates
~$ tar xvfz pandoc-1.13.1.tgz
~$ tar xvfz pandoc-templates.tgz
~$ mv pandoc-templates-1.13.1/* pandoc-1.13.1/data/templates/
~$ cd pandoc-1.13.1
~$ cabal install --force --enable-tests
~$ cabal test
~$ cd ..

Sau đó thì chạy lại lệnh cài đặt gitit ở phía trên

~$ cabal install gitit

Demo

Tạo thư mục và demo

~$ cd ~
~$ mkdir wiki
~$ cd wiki
~$ ~/.cabal/bin/gitit

Truy cập tại địa chỉ http://IP:5001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment