centos离线安装gitlab

  • centos离线安装gitlab已关闭评论
  • 75 views
  • A+
所属分类:linux命令

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

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

关闭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,如下:

centos离线安装gitlab

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 安卓客户端下载
  • 微信扫一扫
  • weinxin
  • 微信公众号
  • 微信公众号扫一扫
  • weinxin
avatar