about.gitlab/
安装参考网址:about.gitlab/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 downloads-packages.s3.amazonaws/ubuntu-14.04/gitlab_7.2.0-omnibus-1_amd64.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_amd64.deb
2.Edit the configuration file to add your hostname
sudo -e /etc/gitlab/gitlab.rb
3.Install and start GitLab
sudogitlab-ctl reconfigure
默认管理员账号密码:
Username: root
Password: 5iveL!fe
For troubleshooting and configuration options
gitlab/gitlab-org/omnibus-gitlab/blob/master/README.md
配置
1.配置postfix
sudodpkg-reconfigure postfix
选择 internet
domain:
hostname:
smtpserver:smtp.sina
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/ 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
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
yorigin = /etc/mailname
mydestination = localhost
relayhost = smtp.sina: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/
填写smtp服务器登录信息:
sudonano/etc/postfix/sasl_passwd
smtp.sina:25 yuanzhencai1990@sina: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.
Connected to localhost.
Escape character is '^]'.
220 sunlights ESMTP Postfix (Ubuntu)
helolocalhost
250 sunlights
mail from:yuanzhencai1990@sina
250 2.1.0 Ok
rcpt to:515265763@qq
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
to:515265763@qq
from:yuanzhencai1990@sina
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 " 172.31.0.199"
GitLab的邮件地址:最好是smtp邮件发送服务器的邮箱地址
gitlab_rails['gitlab_email_from'] = 'yuanzhencai1990@sina'
sudonano /etc/gitlab/gitlab.rb
# Change the external_url to the address your users will type in their browser
external_url '172.31.0.199'
gitlab_rails['gitlab_signup_enabled']=true
#gitlab_rails['smtp_enable'] = true
#gitlab_rails['smtp_address'] = "smtp.qq"
#gitlab_rails['smtp_port'] = 25
#gitlab_rails['smtp_user_name'] = "515265763@qq"
#gitlab_rails['smtp_password'] = "yzc.1234"
如何搭建git服务器#gitlab_rails['smtp_domain'] = "smtp.qq"
#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'
重启GitLab
sudogitlab-ctl reconfigure
查看GitLab状态
sudogitlab-ctlstatus
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

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。