1、安装及配置依赖项:
a)yum install curl policycoreutils-python openssh-server openssh-clients postfix
- [root@izuf6j9tjuw2zd5wodwiztz ~]# yum install curl policycoreutils-python openssh-server openssh-clients postfix
- Loaded plugins: fastestmirror
- Loading mirror speeds from cached hostfile
- Package curl-7.29.0-46.el7.x86_64 already installed and latest version
- Package 2:postfix-2.10.1-6.el7.x86_64 already installed and latest version
- Resolving Dependencies
- --> Running transaction check
- ---> Package policycoreutils-python.x86_64 0:2.5-22.el7 will be installed
- --> Processing Dependency: setools-libs >= 3.3.8-2 for package: policycoreutils-python-2.5-22.el7.x86_64
- --> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
- --> Running transaction check
- ---> Package audit-libs-python.x86_64 0:2.8.1-3.el7 will be installed
- ---> Package setools-libs.x86_64 0:3.3.8-2.el7 will be installed
- --> Finished Dependency Resolution
- Dependencies Resolved
- ===========================================================================================================================================================================
- Package Arch Version Repository Size
- ===========================================================================================================================================================================
- Installing:
- policycoreutils-python x86_64 2.5-22.el7 base 454 k
- Installing for dependencies:
- audit-libs-python x86_64 2.8.1-3.el7 base 75 k
- setools-libs x86_64 3.3.8-2.el7 base 619 k
- Transaction Summary
- ===========================================================================================================================================================================
- Install 1 Package (+6 Dependent packages)
- Total download size: 1.6 M
- Installed size: 5.3 M
- Is this ok [y/d/N]: y
- Downloading packages:
- (1/7): audit-libs-python-2.8.1-3.el7.x86_64.rpm | 75 kB 00:00:00
- (7/7): setools-libs-3.3.8-2.el7.x86_64.rpm | 619 kB 00:00:00
- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Total 9.8 MB/s | 1.6 MB 00:00:00
- Running transaction check
- Running transaction test
- Transaction test succeeded
- Running transaction
- Installing : checkpolicy-2.5-6.el7.x86_64 1/7
- Installing : audit-libs-python-2.8.1-3.el7.x86_64 2/7
- Installing : python-IPy-0.75-6.el7.noarch 3/7
- Installing : libsemanage-python-2.5-11.el7.x86_64 5/7
- Verifying : audit-libs-python-2.8.1-3.el7.x86_64 6/7
- Verifying : checkpolicy-2.5-6.el7.x86_64 7/7
- Installed:
- policycoreutils-python.x86_64 0:2.5-22.el7
- Dependency Installed:
- audit-libs-python.x86_64 0:2.8.1-3.el7 checkpolicy.x86_64 0:2.5-6.el7 libcgroup.x86_64 0:0.41-15.el7 libsemanage-python.x86_64 0:2.5-11.el7
- python-IPy.noarch 0:0.75-6.el7 setools-libs.x86_64 0:3.3.8-2.el7
- Complete!
b)编辑Postfix配置文件(/etc/postfix/main.cf)中的参数“inet_protocols = all” 为 “inet_protocols = ipv4” 保存退出
- # Enable IPv4, and IPv6 if supported
- inet_protocols = ipv4
c)systemctl enable postfix && systemctl start postfix
- [root@izuf6j9tjuw2zd5wodwiztz ~]# systemctl enable postfix && systemctl start postfix
2、下载Gitlab程序
- [root@izuf6j9tjuw2zd5wodwiztz ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm
- --2018-08-20 15:29:43-- https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm
- Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, 2402:f000:1:408:8100::1
- Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:443... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 441423852 (421M) [application/x-redhat-package-manager]
- Saving to: ‘gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm’
- 100%[=================================================================================================================================>] 441,423,852 23.9MB/s in 17s
- 2018-08-20 15:30:02 (25.0 MB/s) - ‘gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm’ saved [441423852/441423852]
- [root@izuf6j9tjuw2zd5wodwiztz ~]# ll
- total 431084
- -rw-r--r-- 1 root root 441423852 Aug 1 05:41 gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm
3、安装Gitlab程序:rpm -ivh gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm
- [root@izuf6j9tjuw2zd5wodwiztz ~]# rpm -ivh gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm
- warning: gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
- Preparing... ################################# [100%]
- Updating / installing...
- 1:gitlab-ce-11.1.4-ce.0.el7 ################################# [100%]
- 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
- For a comprehensive list of configuration options please see the Omnibus GitLab readme
- https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
4、编辑Gitlab配置文件(/etc/gitlab/gitlab.rb)定义访问地址参数external_url
- ## GitLab URL
- ##! URL on which GitLab will be reachable.
- ##! 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.ityww.cn'
5、重载Gitlab配置文件:gitlab-ctl reconfigure
- Running handlers:
- Running handlers complete
- Chef Client finished, 429/613 resources updated in 02 minutes 35 seconds
- gitlab Reconfigured!