在Ubuntu 12.04上安裝GitLab6.0
安裝環境:
操作系統: Ubuntu 12.4 LTS 英文
數據庫: mysql5.5.32
web服務器: nginx1.4.1
首先, 添加git和nginx的ppa,並升級系統到最新。
[plain]
sudo apt-add-repository ppa:git-core/ppa
sudo add-apt-repository ppa:nginx/stable
Software Up to Date
然後, 安裝vim,並設為默認編輯器。
[plain]
# Install vim and set as default editor
sudo apt-get install -y vim
sudo update-alternatives --set editor /usr/bin/vim.basic
最後, 安裝依賴程序。
[plain]
sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev
可選安裝下面兩個程序:
[plain]
sudo apt-get install python-docutils
sudo apt-get install -y postfix
其他步驟,按照官方安裝文檔。
安裝中,需要注意的有兩點:
1. 在安裝GitLab(第6大步)中的“Install Init Script”時,
由
[plain]
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
替換為:
[plain]
sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-0-stable/lib/support/init.d/gitlab
2. 在安裝Nginx(第7大步)中的“Site Configuration”時,
由
[plain]
sudo cp lib/support/nginx/gitlab /etc/nginx/sites-available/gitlab
替換為:
[plain]
sudo curl --output /etc/nginx/sites-available/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-0-stable/lib/support/nginx/gitlab
配置文件修改情況:
(1) Gitlab shell
文件: config.yml
狀態: 默認(不修改)
gitlab_url: "http://localhost/"
(2) Gitlab
I. gitlab
文件: gitlab.yml
狀態: 默認(不修改)
host: localhost
II. unicorn
文件: gitlab.yml
狀態: 默認(不修改)
(3) Nginx
文件: gitlab
狀態: 更改
server_name: localhost
FAQ:
1. 在浏覽器中輸入:http://localhost/後,沒有看到登錄界面。
查看/var/log/nginx/error.log,如果是如下內容:
[plain]
2013/08/23 23:34:44 [emerg] 4775#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
2013/08/23 23:34:53 [emerg] 4781#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
2013/08/23 23:34:59 [emerg] 4787#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
2013/08/23 23:40:14 [emerg] 4857#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
2013/08/23 23:42:41 [emerg] 1058#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
2013/08/23 23:55:04 [emerg] 2883#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
2013/08/24 00:25:45 [emerg] 3679#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
2013/08/24 00:25:55 [emerg] 3683#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
2013/08/24 00:26:48 [emerg] 3696#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/gitlab:10
則刪除/etc/nginx/sites-available/default文件,重新啟動服務(
[plain]
sudo service nginx restart
)即可。