Bitnami Gitlab 安装配置 step by step

http://comedsh.iteye.com/blog/2238200

http://comedsh.iteye.com/blog/2238200


Bitnami Gitlab 安装配置 step by step

  • 博客分类: 
  • git

安装 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

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

    Java代码   收藏代码
    1. config.action_mailer.perform_deliveries = true  
    2. config.action_mailer.raise_delivery_errors = true  
    3. config.action_mailer.delivery_method = :smtp  
    4. config.action_mailer.smtp_settings = {  
    5.   :address => "smtp.163.com",  
    6.   :port => "25",  
    7.   :domain => "163.com",  
    8.   :authentication => :login,  
    9.   :user_name => "yourname",  
    10.   :password => "yourpwd",  
    11.   :enable_starttls_auto => true  
    12. }  
     

    4.2 修改 gitlab.yml 

    Java代码   收藏代码
    1. $ sudo vim /opt/bitnami/apps/gitlab/htdocs/config/gitlab.yml  
    Java代码   收藏代码
    1. ## Email settings  
    2.     # Uncomment and set to false if you need to disable email sending from GitLab (defaulttrue)  
    3.     # email_enabled: true  
    4.     # Email address used in the "From" field in mails sent by GitLab  
    5.     email_from: yourname@163.com  
    6.     email_display_name: GitLab  
    7.     email_reply_to: noreply@example.com  
        注意:gitlab.yml 中的 email_from 的 username 和 production.rb 中的 邮箱 username 必须一致。 

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

  6. 重启,使设置生效
    Java代码   收藏代码
    1. $ sudo /opt/bitnami/ctlscript.sh restart gitlab_sidekiq  
    2. $ sudo /opt/bitnami/ctlscript.sh restart apache  
     
  7. 安装完毕后,如何修改 domain 信息
    Java代码   收藏代码
    1. $ sudo vim /opt/bitnami/apps/gitlab/htdocs/config/gitlab.yml  
        修改该如下配置文件
    Java代码   收藏代码
    1. ## Web server settings (note: host is the FQDN, do not include http://)  
    2.     host: 10.162.102.179  
    3.     port: 8080 # Set to 443 if using HTTPS, see installation.md#using-https for additional HTTPS configuration details  
    4.     https: false # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details  
     
  8. 日志查看
    bitnami gitlab 存放运行时刻的日志路径
    Java代码   收藏代码
    1. /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
    • 1
      点赞
    • 0
      收藏
      觉得还不错? 一键收藏
    • 0
      评论

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

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

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

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

    抵扣说明:

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

    余额充值