linux离线安装git,centos离线安装gitlab 互联网技术圈 互联网技术圈

在线安装就不说了,直接两条命令就搞定了,我们说说离线安装吧。

内部局域网上不了网,所有只能手动安装了,直接开始吧

关闭selinux和防火墙

关闭selinux,修改/etc/selinux/config,如下:

[root@localhost ~]# more /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

# targeted - Targeted processes are protected,

# mls - Multi Level Security protection.

SELINUXTYPE=targeted

关闭防火墙

service iptables stop

禁用防火墙

chkconfig iptables off

安装gitlab

安装下载好的rpm包,安装包如下:

[root@localhost temp]# ls

audit-2.4.5-6.el6.x86_64.rpm

audit-libs-2.4.5-6.el6.x86_64.rpm

audit-libs-python-2.4.5-6.el6.x86_64.rpm

gitlab-ce-10.1.7-ce.0.el6.x86_64.rpm

libcgroup-0.40.rc1-27.el6_10.x86_64.rpm

libselinux-2.0.94-7.el6.x86_64.rpm

libselinux-python-2.0.94-7.el6.x86_64.rpm

libselinux-utils-2.0.94-7.el6.x86_64.rpm

libsemanage-2.0.43-5.1.el6.x86_64.rpm

libsemanage-python-2.0.43-5.1.el6.x86_64.rpm

policycoreutils-2.0.83-30.1.el6_8.x86_64.rpm

policycoreutils-python-2.0.83-30.1.el6_8.x86_64.rpm

setools-libs-3.3.7-4.el6.x86_64.rpm

setools-libs-python-3.3.7-4.el6.x86_64.rpm

安装命令如下:

rpm -Uvh *

出现如下界面,则安装成功,如下:

It looks like GitLab has not been configured yet; skipping the upgrade script.

_______ __ __ __

/ ____(_) /_/ / ____ _/ /_

/ / __/ / __/ / / __ \`/ __ \

/ /_/ / / /_/ /___/ /_/ / /_/ /

\____/_/\__/_____/\__,_/_.___/

Thank you for installing GitLab!

GitLab was unable to detect a valid hostname for your instance.

Please configure a URL for your GitLab instance by setting `external_url`

configuration in /etc/gitlab/gitlab.rb file.

Then, you can start your GitLab instance by running the following command:

sudo gitlab-ctl reconfigure

修改配置

修改访问地址,如上面所述,修改/etc/gitlab/gitlab.rb中的external_url,我这里修改成gitlab.baiked.com,如下:

##! For more details on configuring external_url see:

##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab

external_url 'http://gitlab.baiked.com'

## Roles for multi-instance GitLab

##! The default is to have no roles enabled, which results in GitLab running as an all-in-one instance.

修改端口,默认是80,我们这里80已经给别的服务使用了,所以我修改成9999端口,如下:

##! **Override only if you use a reverse proxy**

##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#setting-the-nginx-listen-port

nginx['listen_port'] = 9999

加载配置

修改完配置后,需要初始化,命令如下:

gitlab-ctl reconfigure

结果如下,则说明安装成功,如下:

Running handlers:

Running handlers complete

Chef Client finished, 365/513 resources updated in 01 minutes 56 seconds

gitlab Reconfigured!

浏览器访问

输入http://gitlab.baiked.com:9999,如下:

75bbbcc555eaf19f8413bd83cad77a74.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值