一键安装GitLab7在RHEL6.4上

无论如何gitlab是个好东西,但是极难安装和配置。bitnami(https://bitnami.com/)的一键安装包虽然可以解决大问题,但是仍有很多人无法配置gitlab+nginx和email发送等等问题。今天特意完整地再梳理一次。对各位读者的问题不再逐一解答。

首先,bitmami的一些版本有问题,无法成功在rhel6.4上成功安装。因此,我找到了一个较新的可以使用的版本7.8.1(响应式页面):

ftp://pepstack.com/pub/tarball/bitnami-gitlab-7.8.1-0-linux-x64-installer.run

(我的ftp不会一直提供,请想要的尽快下载)

那么,最后安装好的效果就是(点击可访问,第一次访问可能会比较慢,要求较新版本的firefox或chrome,IE未测试):

2 需求描述

好了,先把需求陈述一下,如果读者的需求与我不同,我无能为力。假设我有一台web主机(我这里是pepstack.com),我在主机后面创建虚拟机(vm-gitlab),在vm-gitlab上安装gitlab7,然后通过配置web主机上的ngnix,可以通过下面的url访问到我的gitlab:

创建虚拟机vm-gitlab的过程不细说了,如果你使用实体机也是一样的。vm-gitlab安装的是rhel6.4版本。确保在vm内部可以访问外部主机和internet(如ping )。

3 安装gitlab

ssh 到vm-gitlab:

# ssh root@vm-gitlab

下载一键式安装包:

# wget ftp://pepstack.com/pub/tarball/bitnami-gitlab-7.8.1-0-linux-x64-installer.run

安装:

# chmod a+x bitnami-gitlab-7.8.1-0-linux-x64-installer.run

# ./bitnami-gitlab-7.8.1-0-linux-x64-installer.run

安装过程中会提示:

----------------------------------------------------------------------------
Welcome to the Bitnami Gitlab Stack Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.

GitLab : Y (Cannot be edited)

GitLab CI [Y/n] :Y

Is the selection above correct? [Y/n]: Y

----------------------------------------------------------------------------
Installation folder

Please, choose a folder to install Bitnami Gitlab Stack

Select a folder [/opt/gitlab-7.8.1-0]:

----------------------------------------------------------------------------
Create Admin account

Bitnami Gitlab Stack admin user creation

Email Address [user@example.com]: cheungmine@qq.com

Login [user]: master (此处是你登录gitlab用的用户名)

Password : (输入你登录gitlab时要用的密码)
Please confirm your password :  (输入你登录gitlab时要用的密码)
----------------------------------------------------------------------------
Hostname that will be used to create internal URLs. If this value is incorrect,
you may be unable to access your Gitlab installation from other computers. It is
advisable to use a Domain instead of an IP address for compatibility with
different browsers.

Domain [127.0.0.1]:

Do you want to configure mail support? [y/N]: Y

----------------------------------------------------------------------------
Configure SMTP Settings

This is required so your application can send notifications via email.

Default email provider:

[1] GMail
[2] Custom
Please choose an option [1] : 2

----------------------------------------------------------------------------
Configure SMTP Settings

This data is stored in the application configuration files and may be visible to
others. For this reason, it is recommended that you do not use your personal
account credentials.

Username []: cheungmine@qq.com

Password : (输入你的QQ密码)
Re-enter : (输入你的QQ密码)
SMTP Host []: smtp.qq.com

SMTP Port []: 25

Secure connection

[1] None
[2] SSL
[3] TLS
Please choose an option [3] :

----------------------------------------------------------------------------
Setup is now ready to begin installing Bitnami Gitlab Stack on your computer.

Do you want to continue? [Y/n]: Y

----------------------------------------------------------------------------
Please wait while Setup installs Bitnami Gitlab Stack on your computer.

Installing
 0% ______________ 50% ______________ 100%
 #########################################

----------------------------------------------------------------------------
Setup has finished installing Bitnami Gitlab Stack on your computer.

Info: To access the Bitnami Gitlab Stack, go to
:80 from your browser.
Press [Enter] to continue:

4 配置gitlab
配置尤其要小心。下面几个配置文件要用到:

/opt/gitlab-7.8.1-0/apps/gitlab/htdocs/config/environments/production.rb
/opt/gitlab-7.8.1-0/apps/gitlab/htdocs/config/initializers/smtp_settings.rb
/opt/gitlab-7.8.1-0/apps/gitlab/htdocs/config/gitlab.yml
/opt/gitlab-7.8.1-0/apps/gitlab/conf/httpd-app.conf
/opt/gitlab-7.8.1-0/apps/gitlab/gitlab-shell/config.yml

下面逐一说明:

4.1 production.rb

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/15807.html