在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
)即可。