您好,欢迎来到微智科技网。
搜索
您的当前位置:首页GitLab7搭建

GitLab7搭建

来源:微智科技网
官网:https://about.gitlab.com/

安装参考网址:https://about.gitlab.com/downloads/

环境

Ubuntu 14.04

如果是虚拟机的话要改成桥接模式让局域网内其他计算机访问

网络设置

1. 宿主机网络配置: 连接特定的 DNS 后缀: pnp.gw 描述: Intel(R) WiFi Link 1000 BGN 物理地址: 74-E5-0B-99-52-22 已启用 DHCP: 是

IPv4 地址: 172.31.0.229 IPv4 子网掩码: 255.255.248.0 IPv4 默认网关: 172.31.0.1 IPv4 DHCP 服务器: 172.31.0.1

IPv4 DNS 服务器: 223.5.5.5, 223.6.6.6

根据宿主机手动配置虚拟机的网络 2. 虚拟机网络配置: IPv4 地址: 172.31.0.199 IPv4 子网掩码: 255.255.248.0 IPv4 默认网关: 172.31.0.1

IPv4 DNS 服务器: 223.5.5.5, 223.6.6.6

检查下虚拟机能否上网。如果不能上网的会影响后面GitLab发送邮件。 检查下能否被局域网的其他计算机访问

安装

下载

1. Download the package and install everything

wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.2.0-omnibus-1_amd.deb sudo apt-get install openssh-server sudo apt-get install postfix # Select 'Internet Site', using sendmail instead also works, exim has problems sudodpkg -i gitlab_7.2.0-omnibus-1_amd.deb 2. Edit the configuration file to add your hostname sudo -e /etc/gitlab/gitlab.rb 3. Install and start GitLab sudo gitlab-ctl reconfigure 默认管理员账号密码: Username: root Password: 5iveL!fe

For troubleshooting and configuration options

https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

配置

1. 配置postfix

sudodpkg-reconfigure postfix

选择 internet

domain:sunlights.cc hostname:sunlights.cc smtpserver:smtp.sina.com destination:localhost

备份下原来的配置

sudocp /etc/postfix/main.cf/etc/postfix/main.cf_bak

修改配置

sudonano /etc/postfix/main.cf # See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate \"delayed mail\" warnings #delay_warning_time = 4h readme_directory = no # TLS parameters #smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem #smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key #smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. smtpd_relay_restrictions permit_mynetworkspermit_sasl_authenticateddefer_unauth_destination myhostname = sunlights.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases yorigin = /etc/mailname mydestination = localhost relayhost = smtp.sina.com:25 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all default_transport = smtp relay_transport = smtp inet_protocols = all # enable SASL authentication smtp_sasl_auth_enable = yes = # disallow methods that allow anonymous authentication. smtp_sasl_security_options = noanonymous # where to find sasl_passwd smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd # Enable STARTTLS encryption#smtp_use_tls = yes # where to find CA certificates #smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt 填写smtp服务器登录信息: sudonano/etc/postfix/sasl_passwd smtp.sina.com:25 yuanzhencai1990@sina.com:yzc.1234 添加smtp登录信息:

sudopostmap /etc/postfix/sasl_passwd

sudo postfix reload sudo postfix stop sudo postfix start

测试postfix sunlights@ubuntu:~$ telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 sunlights.com ESMTP Postfix (Ubuntu) helo localhost 250 sunlights.com mail from:yuanzhencai1990@sina.com 250 2.1.0 Ok rcpt to:515265763@qq.com 250 2.1.5 Ok data 354 End data with . to:515265763@qq.com from:yuanzhencai1990@sina.com subject:test postfix this is just a test . 250 2.0.0 Ok: queued as 362BA260BCF quit 221 2.0.0 Bye Connection closed by foreign host. 打开邮箱可以收到邮件

2. 配置GitLab

external_url,虚拟机的ip地址 external_url \"http:// 172.31.0.199\"

GitLab的邮件地址:最好是smtp邮件发送服务器的邮箱地址 gitlab_rails['gitlab_email_from'] = 'yuanzhencai1990@sina.com'

sudonano /etc/gitlab/gitlab.rb # Change the external_url to the address your users will type in their browser external_url 'http://172.31.0.199' gitlab_rails['gitlab_signup_enabled']=true #gitlab_rails['smtp_enable'] = true #gitlab_rails['smtp_address'] = \"smtp.qq.com\" #gitlab_rails['smtp_port'] = 25 #gitlab_rails['smtp_user_name'] = \"515265763@qq.com\" #gitlab_rails['smtp_password'] = \"yzc.1234\" #gitlab_rails['smtp_domain'] = \"smtp.qq.com\" #gitlab_rails['smtp_authentication'] = \"login\" #gitlab_rails['smtp_enable_starttls_auto'] = true # If your SMTP server does not like the default 'From: gitlab@localhost' you # can change the 'From' with this setting. gitlab_rails['gitlab_email_from'] = 'yuanzhencai1990@sina.com' 重启GitLab

sudo gitlab-ctl reconfigure 查看GitLab状态 sudo gitlab-ctl status run: nginx: (pid 1069) 11728s; run: log: (pid 1068) 11728s run: postgresql: (pid 1078) 11728s; run: log: (pid 1070) 11728s run: redis: (pid 1077) 11728s; run: log: (pid 1076) 11728s run: sidekiq: (pid 1074) 11728s; run: log: (pid 1073) 11728s run: unicorn: (pid 1072) 11728s; run: log: (pid 1071) 11728s 查看GitLab日志 sudogitlab-ctl tail

至此,GItLab配置结束

使用

访问

使用虚拟机ip地址访问:172.31.0.199,默认管理员账号登录。

Centos 6

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 7swz.com 版权所有 赣ICP备2024042798号-8

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务