centos 7 X86_64 安装gitlab-ce-15.9.3-ce.0.el7.x86_64
Gitlab-ce 首页:
https://packages.gitlab.com/gitlab/gitlab-ce/install
https://about.gitlab.com/install/
安装系统基础工具()
yum install epel-release -y
yum install htop nload iftop nethogs iotop git wget curl screen tree chrony -y
systemctl stop firewalld && systemctl disable firewalld
setenforce 0
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
****错误:
vim /etc/postfix/main.cf
inet_interfaces = localhost
inet_protocols = all
inet_interfaces = all
inet_protocols = all
service postfix start
安装gitlab-ce 的yum源:
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
安装Gitlab-CE-15.9.3
yum install gitlab-ce-15.9.3 -y
vim /etc/gitlab/gitlab.rb
external_url 'http://gitlab.example.com'
改成
external_url 'http://192.168.3.130'
gitlab-ctl reconfigure
用户名:root
密 码:/etc/gitlab/initial_root_password
该密码文件会在创建后24小时后删除
****************************************************************************
Running handlers:
[2023-03-11T23:27:32+08:00] INFO: Running report handlers
Running handlers complete
[2023-03-11T23:27:32+08:00] INFO: Report handlers complete
Infra Phase complete, 573/1542 resources updated in 03 minutes 13 seconds
Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.
NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
访问gitlab首页:
访问 http://192.168.3.130/ | root | CCCCCCCC
部分gitlab 命令:
gitlab-ctl status
gitlab-ctl restart
gitlab-ctl start
gitlab-ctl tail
gitlab-ctl tail nginx
nginx
gitlab-shell
gitlab-workhorse
logrotate
postgresql
redis
unicorn gitlab rails
/var/opt/gitlab/git-data/repositories/root:
/opt/gitlab:
/var/opt/gitlab:gitlab-ctl reconfigure
/etc/gilab:
/var/log/gitlab:
/var/opt/gilab/backups/:
gitlab-ctl reconfigure
gitlab-ctl show-config
gitlab-ctl restart
gitlab 后台中文
gitlab 后台切换中文显示
1.进入gitlab后台
点击右上角个人头像 -> settings -> profile -> Preferred language
2.默认选项是"English" ,选择"简体中文" ,然后点击下面绿色按钮"Update profile settings"
3.刷新页面
Gitlab 邮件设置:
配置邮箱服务的用途
有合并请求时,邮件通知
账号注册时,邮件验证
修改密码时,通过邮件修改
配置步骤:
.开启QQ邮箱的smtp服务(不建议使用163邮箱,发几次之后,就不能发送)
设置--》账户--》smtp--》密保验证--》验证成功返回一串字符串,形状如(sdfsdfasdfasd)
1 安装postfix:
之前已经安装并配置好可以启动起来.
2)配置gitlab.rb:
vim /etc/gitlab/gitlab.rb
gitlab_rails['smtp_enable' ] = true
gitlab_rails['smtp_address' ] = "smtp.qq.com"
gitlab_rails['smtp_port' ] = 465
gitlab_rails['smtp_user_name' ] = "345345434@qq.com"
gitlab_rails['smtp_password' ] = "234234234sdfsd "
gitlab_rails['smtp_domain' ] = "smtp.qq.com"
gitlab_rails['smtp_authentication' ] = "login"
gitlab_rails['smtp_enable_starttls_auto' ] = true
gitlab_rails['smtp_tls' ] = true
gitlab_rails['smtp_pool' ] = false
gitlab_rails['gitlab_email_enabled' ] = true
gitlab_rails['gitlab_email_from' ] = 'xxxxxx@qq.com'
gitlab_rails['gitlab_email_display_name' ] = 'gitlab server'
3)重新加载配置信息
gitlab-ctl reconfigure
4) 重新启动服务
gitlab-ctl restart
5)测试邮件服务是否正常
gitlab-rails console
Notify.test_email('接收方邮件地址' ,'邮件标题' ,'邮件内容' ).deliver_now
按回车,测试发送。
[root@bj-hom-130 gitlab]
--------------------------------------------------------------------------------
Ruby: ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux]
GitLab: 15.9.3 (f030ca96950) FOSS
GitLab Shell: 14.17.0
PostgreSQL: 13.8
------------------------------------------------------------[ booted in 26.00s ]
Loading production environment (Rails 6.1.7.2)
irb(main):001:0>
irb(main):002:0> Notify.test_email('sdfsdfsdf@qq.com' ,'gitlab注册' ,'测试邮件而已 gitlab' ).deliver_now
Delivered mail 640e9e27ebed9_105ae488012386@bj-hom-130.mail (1275.8ms)
=>
irb(main):003:0>
如忘记管理员密码
gitlab-rails console //进入控制台
u=User.where(id :1).first //查找id 为1的用户并赋值给u
u.password='new_password' //修改u的密码
u.password_confirmation='new_password' //确认密码信息
u.save! //保存用户信息
错误:
二 安装出现的问题
1. 安装时卡在ruby_block[wait for logrotate service socket]不动
原本已经安装一次gitlab , 然后卸载重装过程中出现该问题 ,
(1)首先按住CTRL+C强制结束正在安装的程序
(2)运行 sudo systemctl restart gitlab-runsvdir
执行完上述两步之后
gitlab-ctl reconfigure 重新启动程序
备注 : 如果在安装卡在wait for ......地方不动,可以使用本方法试试能否解决
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律