Bitnami Gitlab 安装配置 step by step

本人博客已经迁移至 www.shangyang.me 欢迎大家访问

安装 BItnami Gitlab 的时候,遇到不少坑,总结下

  1. 获取一键安装包
    https://bitnami.com/stack/gitlab
    下载路径为 /home/mine/bitnami-gitlab-7.13.5-0-linux-x64-installer.run

  2. 设置权限
    # 如果不设置权限,安装到最后的时候,会出现某文件写入错误的问题,如何解决者扰人的错误,如下
    问题是在 centos 7 系统中出现,
    第一次安装的时候,提示创建 .git 目录失败,没有权限,接着提示 不能锁定 .git/git_config ...
    让第一次安装执行完成,gitlab 会创建两个目录 /home/git 和 /home/gitlab_ci
    然后卸载 gitlab,
    chown git:git /home/git
    chmod -R 775 /home/git
    重装 gitlab,既无错误安装成功。

    $ sudo chmod -R 775 /home/mine

  3. 安装
    # 启动
    $ sudo /home/mine/bitnami-gitlab-7.13.5-0-linux-x64-installer.run

    直接 next -> next -> next -> Done

    不过,有一步需要注意,当提示配置邮箱服务器的时候,选择 Y

    注:在选择安装路径的时候,选择 /opt/bitnami

  4. 卸载
    $ sudo /opt/bitnami/uninstall

  5. 配置邮箱服务器

    两步:第一步,修改 production.rb;第二步,修改 gitlab.yml

    4.1  修改 proudction.rb

        
    $ sudo vim /opt/bitnami/apps/gitlab/htdocs/config/environments/production.rb
           
        修改该对应的内容如下

      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.163.com",
        :port => "25",
        :domain => "163.com",
        :authentication => :login,
        :user_name => "yourname",
        :password => "yourpwd",
        :enable_starttls_auto => true
      }
     

    4.2 修改 gitlab.yml

    $ sudo vim /opt/bitnami/apps/gitlab/htdocs/config/gitlab.yml
    ## 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: [email protected]
        email_display_name: GitLab
        email_reply_to: [email protected]
        注意:gitlab.yml 中的 email_from 的 username 和 production.rb 中的 邮箱 username 必须一致。 

    这里注意,有个坑,搞了我很久;如果你是新申请的一个 163 的邮箱,这个时候,SMTP 服务默认是没有打开的.....  唯一要做的,就是进入 163 邮箱,打开你的 SMTP 服务。

  6. 重启,使设置生效
    $ sudo /opt/bitnami/ctlscript.sh restart gitlab_sidekiq
    $ sudo /opt/bitnami/ctlscript.sh restart apache
     
  7. 安装完毕后,如何修改 domain 信息
    $ sudo vim /opt/bitnami/apps/gitlab/htdocs/config/gitlab.yml
        修改该如下配置文件
    ## Web server settings (note: host is the FQDN, do not include http://)
        host: 10.162.102.179
        port: 8080 # 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
     
  8. 日志查看
    bitnami gitlab 存放运行时刻的日志路径
    /opt/bitnami/apps/gitlab/htdocs/log
    sidekiq.log  会记录运行时刻遇到的异常信息

  9. Repositories
    Git 代码库是保存在 /opt/bitnami/apps/gitlab/repositories/ 路径下
     

  10. 错误相关
    错误一:
    提交的时候,提示 warnings: unsecure path ... blar blar ... /opt
    该提示表示,/opt 目录的权限过于开放,将 /opt  的权限改为 775 即可修复该问题.

    错误二:

    Transport Error: Cannot get remote repository refs.

    http://218.244.137.212:8080/dev_demo/fenghua_demo.git: not authorized
    检查在Gitlab中注册的用户名和密码有没有输入正确

    错误三:
    sudo: ./bitnami-gitlab-7.13.5-0-linux-x64-installer.run: command not found
    文件权限的问题,改成 775 就可以。

    错误四:
    FATAL:  data directory "/opt/bitnami/postgresql/data" has group or world access
    DETAIL:  Permissions should be u=rwx (0700).
    错误的原因是,错误的修改了 postgresql 的目录权限,正确的权限必须是0700
    改正:chmod -R 700 postgresql

  11. bitnami 官方文档
    https://wiki.bitnami.com/Applications/BitNami_GitLab#How_to_configure_the_email_settings_of_GitLab.3f

猜你喜欢

转载自comedsh.iteye.com/blog/2238200
今日推荐