linux内网安装git,一键安装GitLab7在RHEL6.4上

1 关于gitlab7

无论如何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未测试):

http://pepstack.com/gitlab

2 需求描述

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

http://pepstack.com/gitlab

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

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

http://127.0.0.1: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

......

# config.action_mailer.delivery_method = :sendmail

# Defaults to:

# # config.action_mailer.sendmail_settings = {

# #  location: '/usr/sbin/sendmail',

# #  arguments: '-i -t'

# # }

config.action_mailer.perform_deliveries = true

config.action_mailer.raise_delivery_errors = true

config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {

:address => "smtp.qq.com",

:port => "25",

:domain => "qq.com",

:authentication => :plain,

:user_name => "cheungmine@qq.com",

:password => "********",

:enable_starttls_auto => true

}

config.eager_load = true

config.assets.js_compressor = :uglifier

config.allow_concurrency = false

......

4.2 smtp_settings.rb

# cp smtp_settings.rb.sample smtp_settings.rb

# To enable smtp email delivery for your GitLab instance do the following:

# 1. Rename smtp_settings.rb.sample to smtp_settings.rb

# 2. Edit settings inside this file

# 3. Restart GitLab instance

#

if Rails.env.production?

Gitlab::Application.config.action_mailer.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {

address: "smtp.qq.com",

port: 25,

user_name: "cheungmine@qq.com",

password: "********",

domain: "qq.com",

authentication: :login,

enable_starttls_auto: true,

openssl_verify_mode: 'none'

}

end

4.3 gitlab.yml

# # # # # # # # # # # # # # # # # #

# GitLab application config file  #

# # # # # # # # # # # # # # # # # #

#

# How to use:

# 1. Copy file as gitlab.yml

# 2. Update gitlab -> host with your fully qualified domain name

# 3. Update gitlab -> email_from

# 4. If you installed Git from source, change git -> bin_path to /usr/local/bin/git

# 5. Review this configuration file for other settings you may want to adjust

production: &base

#

# 1. GitLab app settings

# ==========================

## GitLab settings

gitlab:

## Web server settings (note: host is the FQDN, do not include http://)

host: pepstack.com

port: 80                # Set to 443 if using HTTPS, see installation.md#using-https for additional HTTPS configuration details

https: false            # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details

# Uncommment this line below if your ssh host is different from HTTP/HTTPS one

# (you'd obviously need to replace ssh.host_example.com with your own host).

# Otherwise, ssh host will be set to the `host:` value above

# ssh_host: ssh.host_example.com

# WARNING: See config/application.rb under "Relative url support" for the list of

# other files that need to be changed for relative url support

relative_url_root: /gitlab

# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')

# user: git

## Date & Time settings

# Uncomment and customize if you want to change the default time zone of GitLab application.

# To see all available zones, run `bundle exec rake time:zones:all RAILS_ENV=production`

# time_zone: 'UTC'

## Email settings

# Uncomment and set to false if you need to disable email sending from GitLab (default: true)

# email_enabled: true

# Email address used in the "From" field in mails sent by GitLab

email_from: cheungmine@qq.com

support_email: cheungmine@qq.com

# Email server smtp settings are in config/initializers/smtp_settings.rb.sample

# default_can_create_group: false  # default: true

# username_changing_enabled: false # default: true - User can change her username/namespace

## Default theme

##  BASIC  = 1

##  MARS  = 2

##  MODERN = 3

##  GRAY  = 4

##  COLOR  = 5

# default_theme: 2 # default: 2

......

上面文件改动之处在于:

host: pepstack.com

relative_url_root: /gitlab

email_from: cheungmine@qq.com

support_email: cheungmine@qq.com

下面的配置是因为要把gitlab置于nginx后面使用:

4.4 httpd-app.conf

Options -MultiViews

AllowOverride All

Order allow,deny

Allow from all

= 2.3>

Require all granted

SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"

PassengerEnabled on

PassengerAppRoot "/opt/gitlab-7.8.1-0/apps/gitlab/htdocs/"

ModPagespeedDisallow "*"

PassengerUser git

PassengerGroup git

SetEnv MAGIC "/opt/gitlab-7.8.1-0/ruby/lib/ruby/gems/2.0.0/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/src/file-5.08/magic/magic.mgc"

SetEnv PATH "/opt/gitlab-7.8.1-0/Python/bin:${PATH}"

PassengerPreStart http://127.0.0.1:80/gitlab

不同之处在于:

SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"

PassengerPreStart http://127.0.0.1:80/gitlab

4.5 config.yml

...

gitlab_url: http://pepstack.com:80/gitlab/

...

这样我们访问gitlab就是按照下面的地址:

http://pepstack.com/gitlab/

5 主机nginx配置

上面的配置都是在vm-gitlab上进行的,注意打开80:http端口。下面要给主机nginx增加配置,配置文件:

/etc/nginx/conf.d/redmine.conf

内容如下(我同时还提供了redmine服务):

# 指向内网redmine的web服务(192.168.122.21:80)

#

upstream redmine {

server 192.168.122.21:80;

}

upstream gitlab {

server 192.168.122.20:80;

}

server {

server_name pepstack.com;

# /var/log/nginx 本地目录必须存在

access_log  /var/log/nginx/redmine_access.log;

error_log  /var/log/nginx/redmine_error.log;

location /redmine {

try_files $uri @red;      # @red 名字是任意的

}

location /gitlab {

try_files $uri @git;

}

location @red {

proxy_set_header  Host            $host;

proxy_set_header  X-Real_IP        $remote_addr;

proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;

proxy_read_timeout    300;

proxy_connect_timeout  300;

proxy_redirect        off;

proxy_pass http://redmine;  # 指向 upstream redmine

}

location @git {

proxy_set_header  Host            $host;

proxy_set_header  X-Real_IP        $remote_addr;

proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;

proxy_read_timeout    300;

proxy_connect_timeout  300;

proxy_redirect        off;

proxy_pass http://gitlab;  # 指向 upstream gitlab

}

}

即注释掉:include /etc/nginx/sites-enabled/*;

6 启动服务

大功告成,在主机启动nginx:

$ sudo nginx -s reload

在vm-gitlab启动gitlab:

# cd /opt/gitlab-7.8.1-0/

# ./ctlscript.sh restart

a396927fa279ee1c73a752f2dbb3c77f.png

GitLab 的详细介绍:请点这里

GitLab 的下载地址:请点这里

0b1331709591d260c1c78e86d0c51c18.png

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/506523.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

linux显示点阵字体,Fedora 17中文字体显示点阵状的解决方法

在Fedora 17中文字体的显示变成点阵状了,为什么在Fedora 16下中文字体是文泉驿正黑。到Fedora 17之后,中文字体由文泉驿正黑(WenQuanYi Zen Hei)变为WenQuanYi Zen Hei Sharp。这个新字体的特殊之处就是在12磅及以下的中文字体,将显示成点阵字…

c语言打印空心矩形图案的程序,C语言之输出空心棱形图案

#include#includevoid main(){int n,j,i; /*i为行数,j为每行中的项数*/printf("输入图案上三角的高度n:");scanf("%d",&n);;i < n;i) /*打印上三角&#xff0c;(包括中间行)*/{;j < n - i;j){-i || j n - - i * i )printf(" *");el…

c语言优化冒泡法,C语言:冒泡法排序一组数,如何优化?

#define _CRT_SECURE_NO_WARNINGS 1#include#includeint main(){int arr[] { 5, 6, 7, 8, 9 ,1, 2, 3, 4};int i 0;int j 0;int flag;int size sizeof(arr) / sizeof(arr[0]);for (i 0; i < size- 1 ; i){flag 1;//设置标志位&#xff0c;优化冒泡for (j 0; j < s…

android 分享到豆瓣,Android项目总结之社会化分享

随着现在社交网络的日益繁多&#xff0c;众多的社交客户端已占据了人们的大量时间&#xff0c;所以在我们的应用中具有一键分享的功能对提高我们产品的知名度有很大的帮助。新浪微博、腾讯微博、腾讯QQ、微信、QQ空间、豆瓣等众多知名社交站点&#xff0c;都是我们可以分享的去…

android实现自动横竖屏切换,android 中实现横竖屏切换【原创】

我们在使用android手机的时候&#xff0c;发现一些应用有横竖屏切换的功能&#xff0c;一般实现有以下几种方法&#xff1a;一、设置1.通过XML设置横竖屏切换在项目的 AndroidManifest.xml中找到你所指定的activity中加上android:screenOrientation属性&#xff0c;它有以下几个…

超级管理器Android,超级文件管理器app

详情超级文件管理器app&#xff0c;一款帮助你管理手机内存的软件&#xff0c;还可以重命名&#xff0c;移动&#xff0c;删除文件&#xff0c;在Android平台上完美运行&#xff0c;并能够与其他OI系列软件结合使用! 能快速地查找到目标文件&#xff0c;十分方便用户管理自己手…

android miui ios,从iOS到Android——小米11及小米生态实际使用体验

从iOS到Android——小米11及小米生态实际使用体验2021-02-22 15:29:5693点赞155收藏131评论创作立场声明&#xff1a;文中的设备均为自购&#xff0c;无任何特定立场。2021年2月10日&#xff0c;我的iPhoneX手机突然黑屏&#xff0c;拿到Apple Store检测&#xff0c;经诊断是屏…

p50会搭载鸿蒙吗,华为Mate40和华为P50也会搭载鸿蒙,华为Mate30跌至白菜价让路

原标题&#xff1a;华为Mate40和华为P50也会搭载鸿蒙&#xff0c;华为Mate30跌至白菜价让路华为Mate40和华为P50也会搭载鸿蒙&#xff0c;华为Mate30跌至白菜价让路&#xff01;华为P50Pro的机身部分后置摄像头模块的外观有发生了改变&#xff0c;可以看到华为P50Pro并没有将所…

linux将db2账户添加到组_超实用的shell脚本--Linux安全加固设置,值得收藏

概述近几年来Internet变得更加不安全了。网络的通信量日益加大&#xff0c;越来越多的重要交易正在通过网络完成&#xff0c;与此同时数据被损坏、截取和修改的风险也在增加。 只要有值得偷窃的东西就会有想办法窃取它的人。Internet的今天比过去任何时候都更真实地体现出这一点…

迷你世界无人驾驶地铁火车_出口伊斯坦布尔地铁列车“云下线”

轨道世界 RailWorld开放&#xff5c;共享&#xff5c;价值导读 ID&#xff1a;RailWorld出口伊斯坦布尔地铁列车“云下线”全自动无人驾驶&#xff0c;全寿命远程跟踪、诊断和维护&#xff0c;全车内循环感应系统&#xff0c;极具土耳其风情的外观及内饰……7月14日&#xff0c…

java: 程序包com.github.pagehelper不存在_Rust语言正在兴起,Java、Python、C的末日来临?...

您可能从未用Mozilla创建的开源&#xff0c;系统级编程语言Rust编写任何东西&#xff0c;但是您可能会在某个时候写。在Stack Overflow的2019年开发人员调查中&#xff0c;开发人员将Rust评为“最受欢迎的”语言&#xff0c;而Redmonk在半年的语言排名中&#xff0c;Rust 跻身前…

惠安七号机器人创意园_我是F518创意园,请为我投票!

春去秋来&#xff0c;一个轮回又一年。“ 你知道F518创意园开园多久了吗&#xff1f;对的&#xff0c;13年&#xff01;”作为深圳实施“腾笼换鸟”首批项目和深圳申请联合国科教文组织“设计之都”重要组成部分&#xff0c;我们开园至今已经13年了&#xff01;白驹过隙&#x…

c++ 获取文件夹创建时间_手把手教学免费创建个人网站

点击蓝字关注我们可以不成材 不能不成长&#xff01;给大家分享一个非常有用的skill——在GitHub上免费创建个人网站。什么是GitHubGitHub是一个面向开源及私有软件项目的托管平台&#xff0c;因为只支持git 作为唯一的版本库格式进行托管&#xff0c;故名GitHub。在GitHub上…

量子计算机通用程序,基于拓扑量子纠错码的量子计算机,量子计算机程序具有通用性?...

不管量子计算机的内部是由什么组成&#xff0c;量子计算机的快速计算都可以归结为应用于量子比特的简单指令序列&#xff0c;即量子计算机内部的基本信息单位。无论这台计算机是由离子链、超导体结还是硅片组成&#xff0c;事实证明&#xff0c;一次只影响一个或两个量子比特的…

中兴f650是千兆的吗_装宽带送的光猫自带WiFi功能,我还需要买路由器吗?

想必很多家里装过宽带的朋友都想过一个问题&#xff0c;网线入户需要一个光猫&#xff0c;还需要一个路由器&#xff0c;可不可以将两个设备合二为一&#xff0c;或者只用光猫发射WiFi信号行吗&#xff1f;其实是可以的&#xff0c;但为了更好的体验教授建议还是不要这样做。设…

平移刚体上各点的加速度和速度_物理-力学|第七讲|刚体力学

刚体运动学刚体模型刚体是一个特殊的质点系&#xff0c; 刚体上任意两质点间距离保持不变。刚体模型可以看成是现实中劲度系数极大的物体的抽象化&#xff0c;这类物体本身的形变对其运动的影响可以忽略&#xff0c;比如一个篮球&#xff0c;当其与地面碰撞时必然会产生形变&am…

改变定时器获取传感器频度_称重传感器在高速定量分装系统的应用

高速定量分装系统由微机控制称重传感器的称重和比较&#xff0c;并输出控制信号&#xff0c;执行定值称量&#xff0c;控制外部给料系统的运转&#xff0c;实行自动称量和快速分装的任务。  系统采用MCS-51单片机和V/F电压频率变换器等电子器件&#xff0c;其硬件电路框图如图…

c++没有终结符的多行输入如何停止_如何使用iloc和loc 对Pandas Dataframe进行索引和切片...

在这篇文章中&#xff0c;我们将使用iloc和loc来处理数据。更具体地说&#xff0c;我们将通过iloc和loc例子来学习切片和索引。一旦我们将一个数据集加载为Pandas dataframe&#xff0c;我们通常希望根据某些条件开始访问该数据的特定部分。例如&#xff0c;如果我们的数据集包…

手机发电脑邮箱未开启服务器,手机邮箱无法发送和接收邮件时发生了什么

你好&#xff01;您是2113&#xff0c;是通过手机自己的电子邮件添加5261邮箱4102吗&#xff1f;我介绍了QQ邮箱的添加&#xff0c;您必须打开接收1653并发送服务.您可以在设置---添加帐户中找到邮件首先&#xff0c;您需要登录到邮箱的Web版本&#xff0c;并在帐户中设置设置P…

android 上下数字滚动_原来PPT数字还有这么高大上的展示方式

数字&#xff0c;是PPT当中非常重要的元素&#xff0c;说明价格、呈现销量、展示性能等等多种场合都有使用&#xff0c;数据也是PPT当中最直观的表现形式。那么&#xff0c;PPT当中的数字要怎么表现才显得高逼格呢&#xff1f;在这里介绍一个小技巧&#xff1a;动态滚动展示。先…