Linux Centos7下安装GitLab最详细教程
来源:互联网 发布:c语言什么时候用void 编辑:程序博客网 时间:2024/05/19 16:06
Linux下GitLab的安装部署
Gitlab官网:https://about.gitlab.com/installation/#centos-7
1、安装和配置必要的依赖项。
在CentOS上,以下命令也将在系统防火墙中打开HTTP和SSH访问。
sudo yum install curl policycoreutils openssh-server openssh-clientssudo systemctl enable sshdsudo systemctl start sshdsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfixsudo firewall-cmd --permanent --add-service=httpsudo systemctl reload firewalld
2、添加GitLab仓库,并安装到服务器上
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bashsudo yum install gitlab-ce
手动下载文件,然后使用rpm命令安装
curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-XXX.rpm/downloadrpm -i gitlab-ce-XXX.rpm
3、启动GitLab
sudo gitlab-ctl reconfigure
4、打开浏览器访问,默认80端口
你第一次的访问,需要设置初始管理员帐户的密码。默认的帐户的用户名是root。
关闭注册功能 Admin Area > Settings >Sign-up Restrictions
5、常用配置
- 修改内置nginx端口号,默认是80,修改
vim var/opt/gitlab/nginx/conf/gitlab-http.conf
server { listen *:8222; ......
- gitlab本身采用80端口,配置GitLab的URL,修改
vim /etc/gitlab/gitlab.rb
external_url 'http://127.0.0.1:8222'
每次重新配置,都需要执行sudo gitlab-ctl reconfigure
使之生效。
6、日常管理
- 常用命令
gitlab-ctl start|stop|status|restart
比如查看状态:
[root@iZ234865htyZ ~]# gitlab-ctl statusrun: gitaly: (pid 12614) 97739s; run: log: (pid 3429) 159390srun: gitlab-monitor: (pid 12622) 97738s; run: log: (pid 3610) 159368srun: gitlab-workhorse: (pid 12625) 97738s; run: log: (pid 3443) 159384srun: logrotate: (pid 947) 446s; run: log: (pid 3474) 159382srun: nginx: (pid 14129) 97293s; run: log: (pid 2415) 103679srun: node-exporter: (pid 12648) 97737s; run: log: (pid 3509) 159378srun: postgres-exporter: (pid 12654) 97736s; run: log: (pid 3559) 159370srun: postgresql: (pid 12660) 97736s; run: log: (pid 3262) 159439srun: prometheus: (pid 12668) 97735s; run: log: (pid 3491) 159380srun: redis: (pid 12678) 97735s; run: log: (pid 2829) 159471srun: redis-exporter: (pid 12682) 97735s; run: log: (pid 3525) 159372srun: sidekiq: (pid 9931) 14072s; run: log: (pid 3415) 159392srun: unicorn: (pid 14261) 97263s; run: log: (pid 3380) 159393s
- 查看日志
/var/log/gitlab
可以进去查看访问日志以及报错日志等。
gitlab-ctl tail #查看所有日志gitlab-ctl tail nginx/gitlab_access.log #查看nginx访问日志
6、卸载GitLab
通过以下几步就可以彻底卸载gitlab
- 停止gitlab,执行
sudo gitlab-ctl stop
- 卸载gitlab,执行
sudo rpm -e gitlab-ce
- 查看gitlab进程,杀掉第一个守护进程
kill -9 pid
- 删除gitlab文件,执行
find / -name gitlab|xargs rm -rf
删除所有包含gitlab的文件及目录,再执行gitlab-ctl uninstall
删除自动在root下备份的配置文件。
阅读全文
0 0
- Linux Centos7下安装GitLab最详细教程
- CentOS7下安装GitLab
- CentOS7下安装GitLab
- CentOS7下安装GitLab
- 史上最详细最全的Linux上安装Oracle的教程-centos7-humf
- linux下安装gitlab
- linux下安装gitlab
- VMware 12 虚拟机下安装Linux CentOS7.0 超详细图文教程
- Linux centos7环境下MySQL安装教程
- 在centos7下安装gitlab-runner
- VMware虚拟机下安装CentOS7.0超详细图文教程
- (一) Linux Centos7下SVN服务器搭建详细教程
- 新手学Linux:在VMware14中安装CentOS7详细教程
- Linux下gitlab安装使用
- CentOS7 安装配置GitLab
- Centos7安装gitlab
- CentOS7 安装GitLab
- Centos7安装配置gitlab
- 将tomcat注册处为windows服务
- 实习生的面试记录(一)
- idhttp post
- 资源管理器Assets Manager ---热更新
- SQL Server中角色与权限管理
- Linux Centos7下安装GitLab最详细教程
- mysql中文乱码的解决方法
- MVC模式和三层架构之间的关系
- binbinyang-- Retrofit 2.0的简单使用(入门篇)-GET请求
- JedisCluster源码解读:集群初始化、slot(槽)的分配、值的存取
- grafana+influxdb+python实现监控cpu、内存
- QT HTTP下载网络文件
- 【二叉树】DFS计算路径和,保存路径【113. Path Sum II】【112. Path Sum】
- 记录linux 命令