06.Linux系统-GitLab版本控制服务安装部署
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了06.Linux系统-GitLab版本控制服务安装部署,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2416字,纯文字阅读大概需要4分钟。
内容图文
官方文档:https://about.gitlab.com/install/#centos-7
1.yum install -y curl policycoreutils-python openssh-server
2.systemctl start sshd
3.yum install postfix
4.systemctl start postfix
注:报错就改/etc/postfix/main.cf-->inet_interfaces = all
5.curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | bash
6.EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee
建议下载对应版本然后yum install -y xxxxx 在修改/etc/gitlab/gitlab.conf中的EXTERNAL_URL
首先修改gitlab.rb文件再进行加载配置文件,不然会冲突
gitlab命令:gitlab-ctl reconfigure 刷新加载配置文件
gitlab-ctl stop/statr/status
注: 首先呢 如果是个空机器什么都不用管 域名映射直接访问就行了
如果本地有现有的Nginx,在启动gitlab就会出现两个Nginx冲突的问题,需要以下方法修改
一般在迁移的时候会备份一下然后copy.tar文件gitlab备份
修改配置文件/etc/gitlab/gitlab.rb
gitlab_rails[‘manage_backup_path‘] = true
gitlab_rails[‘backup_path‘] = "/data/gitlab/backups" //gitlab备份目录
gitlab_rails[‘backup_archive_permissions‘] = 0644 //生成的备份文件权限
gitlab_rails[‘backup_keep_time‘] = 7776000 //备份保留天数为3个月(即90天,这里是7776000秒)
gitlab备份恢复:
gitlab-rake gitlab:backup:create
gitlab-rake gitlab:backup:restore BACKUP=1510472027_2017_11_12_9.4.5-ee
使用现有Nginx需要进行如下配置:
gitlab.rb文件配置详情
external_url ‘http://git.LuckyHaTech.con‘
gitlab_workhorse[‘listen_addr‘] = "xx.xxx.xx.xxx:9080"
unicorn[‘port‘] = 9080
web_server[‘external_users‘] = [‘root‘]
nginx[‘enable‘] = false
Nginx配置详情: 直接添加以下内容即可,此配置未加载日志,可自行配置;更改端口确保与gitlab.rb文件中的端口一致即可
upstream gitlab {
server unix://var/opt/gitlab/gitlab-rails/sockets/gitlab.socket;
}
server {
listen 80;
server_name git.LuckyHaTech.con;
server_tokens off;
root /opt/gitlab/embedded/service/gitlab-rails/public;
client_max_body_size 250m;
location / {
try_files $uri $uri/index.html $uri.html @gitlab;
}
location @gitlab {
proxy_read_timeout 300; # Some requests take more than 30 seconds.
proxy_connect_timeout 300; # Some requests take more than 30 seconds.
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://localhost:9080;
}
location ~ ^/(assets)/ {
root /opt/gitlab/embedded/service/gitlab-rails/public;
expires max;
add_header Cache-Control public;
}
error_page 502 /502.html;
}
重载Nginx
systemctl reload nginx.service
重载gitlab
gitlab-ctl reconfigure
访问域名,完毕!
原文:https://www.cnblogs.com/LuckyHaTech/p/11988191.html
内容总结
以上是互联网集市为您收集整理的06.Linux系统-GitLab版本控制服务安装部署全部内容,希望文章能够帮你解决06.Linux系统-GitLab版本控制服务安装部署所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。