gitlab 搭建(基于现有nginx)
2024-10-21 02:44:32
普通搭建请看:gitlab 搭建
一.gitlab搭建
1.添加GitLab镜像源并安装gitlab服务器
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
2.安装gitlab 安装命令:安装过程需要些时间
rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
3.修改gitlab配置文件指定服务器ip和自定义端口:
vim /etc/gitlab/gitlab.rb
external_url 'http://localhost:8099'
nginx['enable'] = false
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:8098" //这个端口号一会和Nginx代理的端口号要一致
4.汉化gitlab
安装git
yum install -y git
克隆获取汉化版本库
项目地址为:https://gitlab.com/xhang/gitlab
我的gitlab版本为10.5.1
git clone https://gitlab.com/xhang/gitlab.git -b v10.0.0-zh
想要其他版本的gitlab:
git clone https://gitlab.com/xhang/gitlab.git -b vX.X.X-zh即可
停止gitlab服务
gitlab-ctl stop
进入git下载的gitlab项目
cd gitlab
比较汉化标签和原标签,导出 patch 用的 diff 文件到/root下
git diff v10.0.0 v10.0.0-zh > ../10.0.0-zh.diff
回到/root目录
cd
将10.0.0-zh.diff作为补丁更新到gitlab中
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.0-zh.diff
启动gitlab
gitlab-ctl reconfigure
gitlab-ctl start
二、nginx配置
vi /etc/nginx/conf/vhost/gitlab-http.conf
server {
listen 8099; #我的gitlab一般使用8099端口访问
server_name localhost; location / {
root html;
index index.html index.htm;
proxy_pass http://127.0.0.1:8098; #这里与前面设置过的端口一致
}
}
重启nginx
systemctl restart nginx
开机自启动gitlab
systemctl enable gitlab-runsvdir
输入地址:192.168.233.135:8099访问gitlab
进入后会提示添加密码
默认账号:root 或admin@example.com
参考:gitlab自带的Nginx与原Nginx冲突的解决方案
最新文章
- 11.Configure Many-to-Many(配置多对多关系)【Code-First系列】
- 使用 Productivity Power Tools 高级扩展 来帮助你提高 VS2012 的工作效率
- Web API应用架构在Winform混合框架中的应用(2)--自定义异常结果的处理
- Wrangle – 响应式的,触摸友好的多选插件
- ContentProvider总结
- Python webpy微信公众号开发之 回复图文消息
- Wps的ppt里 让图片按顺序出现 就是点击一下 出现一张照片
- [GIF] GIF Loop Coder Single Mode
- ORACLE添加作业
- 如何完全退出android应用程序
- 关于python27 中文编码
- [LeetCode]题解(python):146-LRU Cache
- 一个简单二叉树的C++实现(一)
- CSS 控制应为Html页面高度导致抖动的问题
- JavaScript 计算指定月份有多少天
- 解决winform窗体闪烁问题
- [ZOJ 4014] Pretty Matrix
- PIL: 建立一个GIF图
- Metadata获取的三种方式
- taro之React Native 端开发研究