gitlab 搭建(基于现有nginx)

普通搭建请看: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冲突的解决方案
posted @   py卡卡  阅读(1018)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
点击右上角即可分享
微信分享提示