• gitlab环境准备


    1.准备环境

    gitlab只支持linux系统,本人在虚拟机下使用Ubuntu作为操作系统,gitlab镜像要使用和操作系统版本对应的版本,(ubuntu18.04,gitlab-ce_13.2.3-ce.0_amd64 .deb)

    1. book@100ask:/$ lsb_release -a
    2. No LSB modules are available.
    3. Distributor ID: Ubuntu
    4. Description: Ubuntu 18.04.2 LTS
    5. Release: 18.04
    6. Codename: bionic

    2.下载gitlab

    gitlab官网下载速度较慢且后续配置较麻烦,所以使用清华大学镜像,网址如下

    Index of /gitlab-ce/ubuntu/pool/bionic/main/g/gitlab-ce/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

    将gitlab镜像放入ubuntu某个路径下

    3.安装前先安装依赖

    安装邮件服务的时候会出现邮件配置,使用左右键和回车键选择确定、取消,弹出列表选项的时候,选择Internet Site

    1. sudo apt update
    2. sudo apt install ca-certificates curl openssh-server postfix

    4.在放镜像的安装gitlab 

    sudo pdkg -i gitlab-ce_13.2.3-ce.0_amd64 

    5.安装成功提示

    1. book@100ask:~$ sudo dpkg -i gitlab-ce_13.2.3-ce.0_amd64\ .deb
    2. Selecting previously unselected package gitlab-ce.
    3. (Reading database ... 133527 files and directories currently installed.)
    4. Preparing to unpack gitlab-ce_13.2.3-ce.0_amd64 .deb ...
    5. Unpacking gitlab-ce (13.2.3-ce.0) ...
    6. Setting up gitlab-ce (13.2.3-ce.0) ...
    7. It looks like GitLab has not been configured yet; skipping the upgrade script.
    8. *. *.
    9. *** ***
    10. ***** *****
    11. .****** *******
    12. ******** ********
    13. ,,,,,,,,,***********,,,,,,,,,
    14. ,,,,,,,,,,,*********,,,,,,,,,,,
    15. .,,,,,,,,,,,*******,,,,,,,,,,,,
    16. ,,,,,,,,,*****,,,,,,,,,.
    17. ,,,,,,,****,,,,,,
    18. .,,,***,,,,
    19. ,*,.
    20. _______ __ __ __
    21. / ____(_) /_/ / ____ _/ /_
    22. / / __/ / __/ / / __ `/ __ \
    23. / /_/ / / /_/ /___/ /_/ / /_/ /
    24. \____/_/\__/_____/\__,_/_.___/
    25. Thank you for installing GitLab!
    26. GitLab was unable to detect a valid hostname for your instance.
    27. Please configure a URL for your GitLab instance by setting `external_url`
    28. configuration in /etc/gitlab/gitlab.rb file.
    29. Then, you can start your GitLab instance by running the following command:
    30. sudo gitlab-ctl reconfigure
    31. For a comprehensive list of configuration options please see the Omnibus GitLab readme
    32. https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

    6.安装完配置网址

    修改/etc/gitlab/gitlab.rb中的external_url配置访问页面,因为我是本地的虚拟机中安装的,所以可配置虚拟机的IP地址 external_url ‘http://localhost’

    1. book@100ask:/$ cd /etc/gitlab/
    2. book@100ask:/etc/gitlab$ ls
    3. gitlab.rb gitlab-secrets.json trusted-certs
    4. book@100ask:/etc/gitlab$ sudo vim gitlab.rb
    external_url 'http://192.168.0.104'
    

    7.配置完,初始化gitlab

    sudo gitlab-ctl reconfigure

    8.检查gitlab是否安装好,用如下命令检查

    sudo gitlab-ctl status

    正常提示如下 

    1. book@100ask:/etc/gitlab$ sudo gitlab-ctl status
    2. run: alertmanager: (pid 23499) 35390s; run: log: (pid 23133) 35508s
    3. run: gitaly: (pid 23463) 35394s; run: log: (pid 22470) 35661s
    4. run: gitlab-exporter: (pid 23445) 35394s; run: log: (pid 22995) 35532s
    5. run: gitlab-workhorse: (pid 23422) 35396s; run: log: (pid 22897) 35571s
    6. run: grafana: (pid 23596) 35389s; run: log: (pid 23355) 35425s
    7. run: logrotate: (pid 56544) 3153s; run: log: (pid 22931) 35560s
    8. run: nginx: (pid 22901) 35568s; run: log: (pid 22915) 35565s
    9. run: node-exporter: (pid 23435) 35395s; run: log: (pid 22971) 35548s
    10. run: postgres-exporter: (pid 23511) 35390s; run: log: (pid 23197) 35502s
    11. run: postgresql: (pid 22597) 35647s; run: log: (pid 22605) 35646s
    12. run: prometheus: (pid 23474) 35394s; run: log: (pid 23043) 35516s
    13. run: puma: (pid 22781) 35587s; run: log: (pid 22795) 35584s
    14. run: redis: (pid 22414) 35671s; run: log: (pid 22430) 35668s
    15. run: redis-exporter: (pid 23454) 35395s; run: log: (pid 23014) 35521s
    16. run: sidekiq: (pid 22798) 35581s; run: log: (pid 22810) 35578s

    9.在本地window下的浏览器中输入http://192.168.0.104

    10.重新设置密码

    输入两次密码后,点击Change your password就可以了

    11.登录使用root和刚设置的密码

    12.正常登录显示

  • 相关阅读:
    cv_for_nlp
    启动微服务,提示驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接
    Mac搭建appium环境及python运行代码示例
    软件架构师考试的真实感受
    XSS-labs靶场实战(二)——第4-6关
    vscode config
    华为机试 - 堆栈中的剩余数字
    MYSQLg高级------Sharding-JDBC 实现读写分离
    DDoS攻击--防护本质
    配置fail2ban的记录
  • 原文地址:https://blog.csdn.net/pingxiaozhao/article/details/134493052