阿里云centOS6.8下安装gitlab CE
2017-06-01 16:53
267 查看
刚刚在阿里云上搭建了gitlab,这里和大家分享一下安装过程:
我的实例是centOS6.8,具体如下
系统上之前安装过LAMP环境(即apache、mysql、php,这是为了部署wordpress),还安装了tomcat8,其中apache使用80端口、tomcat使用8080端口。
好,现在开始安装过程:
为方便直接切换到root用户,然后开始安装相关依赖
[root@iZbp14cvwowqu27clxb6pxZ ~]# yum install curl policycoreutils openssh-server openssh-clients
[root@iZbp14cvwowqu27clxb6pxZ ~]# service sshd restart
[root@iZbp14cvwowqu27clxb6pxZ ~]# yum install postfix
[root@iZbp14cvwowqu27clxb6pxZ ~]# service postfix restart
现在开始正式安装gitlab,新建 /etc/yum.repos.d/gitlab-ce.repo,内容为:
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
上面的操作是使用镜像提高下载安装的速度,继续回到命令行:
[root@iZbp14cvwowqu27clxb6pxZ ~]# yum makecache
[root@iZbp14cvwowqu27clxb6pxZ ~]# yum install gitlab-ce
至此,gitlab 安装完毕!但不要急着去启动,我们现更改一些配置
修改配置文件 /etc/gitlab/gitlab.rb
中的下面两项
external_url 'http://你的外网IP:82'
80端口已被Apache占用
unicorn['port'] =
1986 8080端口已被Tomcat占用
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl reconfigure
更改配置文件后,重新加载使改动配置生效,并启动gitlab
检查是否安装成功并且启动正常:
出现上图所示结果就表明服务安装成功了,可以通过浏览器进行访问了,具体不在赘述,网上有很多使用教程。
如果上述安装方法未能成功,可以直接去官网下载rpm安装包,下载地址:点击打开链接
选择一个rpm版本,下载后传到服务器上,然后执行如下命令进行安装
[root@iZbp14cvwowqu27clxb6pxZ home]# rpm -i gitlab-ce-7.10.4-omnibus-1.x86_64.rpm
一些常用命令:
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl status
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl tail
--查看所有日志
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl tail nginx/gitlab_access.log
--查看nginx访问日志
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl tail unicorn --跟踪unicorn的状态
一些目录结构:
主配置文件:/etc/gitlab/gitlab.rb // 可以自定义一些邮件服务等
日志地址:/var/log/gitlab/ // 对应各服务的打印日志
服务地址:/var/opt/gitlab/ // 对应各服务的主目录
仓库地址:/var/opt/gitlab/git-data // 记录项目仓库等提交信息
重置配置:gitlab-ctl reconfigure // 不要乱用,会重置为最原始的配置的
重启服务:gitlab-ctl stop/start/restart/uninstall
// 停止、启动、重启、卸载
默认安装:postgres、nginx、redis、unicorn ……
我的实例是centOS6.8,具体如下
系统上之前安装过LAMP环境(即apache、mysql、php,这是为了部署wordpress),还安装了tomcat8,其中apache使用80端口、tomcat使用8080端口。
好,现在开始安装过程:
为方便直接切换到root用户,然后开始安装相关依赖
[root@iZbp14cvwowqu27clxb6pxZ ~]# yum install curl policycoreutils openssh-server openssh-clients
[root@iZbp14cvwowqu27clxb6pxZ ~]# service sshd restart
[root@iZbp14cvwowqu27clxb6pxZ ~]# yum install postfix
[root@iZbp14cvwowqu27clxb6pxZ ~]# service postfix restart
现在开始正式安装gitlab,新建 /etc/yum.repos.d/gitlab-ce.repo,内容为:
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
上面的操作是使用镜像提高下载安装的速度,继续回到命令行:
[root@iZbp14cvwowqu27clxb6pxZ ~]# yum makecache
[root@iZbp14cvwowqu27clxb6pxZ ~]# yum install gitlab-ce
至此,gitlab 安装完毕!但不要急着去启动,我们现更改一些配置
修改配置文件 /etc/gitlab/gitlab.rb
中的下面两项
external_url 'http://你的外网IP:82'
80端口已被Apache占用
unicorn['port'] =
1986 8080端口已被Tomcat占用
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl reconfigure
更改配置文件后,重新加载使改动配置生效,并启动gitlab
检查是否安装成功并且启动正常:
出现上图所示结果就表明服务安装成功了,可以通过浏览器进行访问了,具体不在赘述,网上有很多使用教程。
如果上述安装方法未能成功,可以直接去官网下载rpm安装包,下载地址:点击打开链接
选择一个rpm版本,下载后传到服务器上,然后执行如下命令进行安装
[root@iZbp14cvwowqu27clxb6pxZ home]# rpm -i gitlab-ce-7.10.4-omnibus-1.x86_64.rpm
一些常用命令:
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl status
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl tail
--查看所有日志
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl tail nginx/gitlab_access.log
--查看nginx访问日志
[root@iZbp14cvwowqu27clxb6pxZ ~]# gitlab-ctl tail unicorn --跟踪unicorn的状态
一些目录结构:
主配置文件:/etc/gitlab/gitlab.rb // 可以自定义一些邮件服务等
日志地址:/var/log/gitlab/ // 对应各服务的打印日志
服务地址:/var/opt/gitlab/ // 对应各服务的主目录
仓库地址:/var/opt/gitlab/git-data // 记录项目仓库等提交信息
重置配置:gitlab-ctl reconfigure // 不要乱用,会重置为最原始的配置的
重启服务:gitlab-ctl stop/start/restart/uninstall
// 停止、启动、重启、卸载
默认安装:postgres、nginx、redis、unicorn ……
相关文章推荐
- 阿里云ECS-centos6.8下 安装配置mysql5.7
- CentOS 初体验十四:阿里云安装Gitlab
- 阿里云CentOS6.8下使用yum安装mysql,并远程登陆mysql
- CentOS 7.2安装gitlab-ce
- 阿里云Centos6 Linux安装gitlab 步骤。
- 阿里云CentOS 6.4搭建Gitlab 6.4(源码安装)
- CentOS 7.4 安装GitLab CE 10.3.4和使用中的基本问题解答
- 阿里云ESC---Centos安装Docker CE
- Centos6.8下gitLab的安装
- 阿里云CentOS 6.8下源码安装FastDFS服务
- centos安装gitlab-ce
- Centos Docker CE安装及设置阿里云为镜像仓库
- centos6.4安装GitLab
- CentoS 下安装gitlab
- 阿里云服务器下安装LAMP环境(CentOS Linux 6.3) 安装与配置 FTP 服务器
- 阿里云服务器CentOS 5.7(64位)安装配置LAMP服务器(Apache+PHP5+MySQL)
- RHEL(redhat 5.x,6.x)和CentOS上Gitlab安装全过程
- 阿里云服务器下安装LAMP环境(CentOS Linux 6.3)
- centos 6.5安装GitLab全过程和问题记录
- 阿里云服务器下安装LAMP环境(CentOS Linux 6.3) 安装与配置 Apache 服务