Ubuntu 14.04.3安装 gitlab-ce_7.10.4(web服务)

本文涉及的产品
云数据库 Tair(兼容Redis),内存型 2GB
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
云原生数据库 PolarDB MySQL 版,通用型 2核8GB 50GB
简介: Ubuntu 14.04.3安装 gitlab-ce_7.10.4(web服务)

1:系统和软件:


root@ubuntu1:/home/ubuntu1# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.3 LTS
Release:	14.04
Codename:	trusty
AI 代码解读

2:下载gitlab安装包:


https://about.gitlab.com/downloads/archives/
AI 代码解读

注:下载相应的系统对应的版本。

3:安装需要的openssh和mail服务:


sudo apt-get install openssh-server
sudo apt-get install postfix 
AI 代码解读


注:邮件选择:No configuration!之后自己配置!
4:安装“gitlab-ce_7.10.4~omnibus-1_amd64.deb”,[内含Ruby、Redis,Nginx和PostgreSQL]


sudo dpkg -i gitlab-ce_7.10.4~omnibus-1_amd64.deb
AI 代码解读


5:配置访问域名端口和邮箱:


sudo vim /etc/gitlab/gitlab.rb

#unicorn端口冲突--配置9090,默认8080!
unicorn['port'] = 9090
#配置gitlab的域名或ip和端口
external_url 'http://192.168.1.110:8080'
#配置邮件
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "eg.smtp.163.com"
gitlab_rails['smtp_port'] =25
gitlab_rails['smtp_user_name'] = "your email"
gitlab_rails['smtp_password'] = "your passwd"
gitlab_rails['smtp_domain'] = "eg.smtp.163.com"
gitlab_rails['smtp_authentication'] = :login
gitlab_rails['smtp_enable_starttls_auto'] = true
#163邮箱,修改gitlab配置的发信人
gitlab_rails['gitlab_email_from'] = "your email"
user["git_user_email"] = "your email"
AI 代码解读


注:若nginx有权限问题问题则将nginx.conf中启动用户修改成root.


6:GitLab进行重加载gitlab.rb配置启动:


sudo gitlab-ctl reconfigure
AI 代码解读

7:检测GitLab状态:


sudo gitlab-ctl status
run: logrotate: (pid 16722) 2161s; run: log: (pid 3316) 45362s
run: nginx: (pid 3297) 45364s; run: log: (pid 3296) 45364s
run: postgresql: (pid 3180) 45383s; run: log: (pid 3179) 45383s
run: redis: (pid 3081) 45389s; run: log: (pid 3080) 45389s
run: sidekiq: (pid 3272) 45370s; run: log: (pid 3271) 45370s
run: unicorn: (pid 3244) 45372s; run: log: (pid 3243) 45372s
AI 代码解读

注:若状态都为down,则使用,启动:


sudo gitlab-ctl start
ok: run: logrotate: (pid 14246) 1s
ok: run: nginx: (pid 14249) 0s
ok: run: postgresql: (pid 14257) 0s
ok: run: redis: (pid 14265) 1s
ok: run: sidekiq: (pid 14269) 0s
ok: run: unicorn: (pid 14273) 1s
AI 代码解读


8:检查GitLab的日志:


sudo gitlab-ctl tail
AI 代码解读

9:请求git的web版:http://192.168.1.110:8080/

  由于GitLab包自带了Ruby、Redis,Nginx和PostgreSQL,所以也就不需要考虑太多兼容性的问题。

  直接Web登录GitLab所在的服务器,并使用帐号root,密码5iveL!fe来登录GitLab{此密码为默认}。

  首次登录GitLab会强行让你重置密码,然后就可以进入GitLab了。


10:停止服务


sudo gitlab-ctl stop
ok: down: logrotate: 0s, normally up
ok: down: nginx: 1s, normally up
ok: down: postgresql: 0s, normally up
ok: down: redis: 1s, normally up
ok: down: sidekiq: 0s, normally up
ok: down: unicorn: 1s, normally up
AI 代码解读

问题1:注:错误码对应解释网易服务器smtp机器要求身份验证帐号和发信帐号必须一致,如果用户在发送邮件时,身份验证帐号和发件人帐号是不同的,因此拒绝发送。修改gitlab.rb,修改发信人和身份验证帐号一致,163发信OK。

问题2:Nginx默认监听80端口,unicorn默认监听8080端口,如使用此两个端口请修改配置!


日志附件:

1:


root@dubbo:/home/install# sudo dpkg -i gitlab-ce_7.10.4~omnibus-1_amd64.deb 
Selecting previously unselected package gitlab-ce.
(Reading database ... 56801 files and directories currently installed.)
Preparing to unpack gitlab-ce_7.10.4~omnibus-1_amd64.deb ...
Unpacking gitlab-ce (7.10.4~omnibus-1) ...
Setting up gitlab-ce (7.10.4~omnibus-1) ...
dpkg-query: package 'gitlab' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
gitlab: Thank you for installing GitLab!
gitlab: Configure and start GitLab by running the following command:
gitlab: 
gitlab: sudo gitlab-ctl reconfigure
gitlab: 
gitlab: GitLab should be reachable at http://dubbo
gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab: 
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab: 
It looks like GitLab has not been installed yet; skipping the upgrade script.
AI 代码解读

2:


root@dubbo:/home/dubbo# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:32000         0.0.0.0:*               LISTEN      2334/java       
tcp        0      0 127.0.0.1:9090          0.0.0.0:*               LISTEN      14288/config.ru 
tcp        0      0 0.0.0.0:8500            0.0.0.0:*               LISTEN      14249/nginx          
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      958/sshd        
tcp        0      0 127.0.0.1:48350         0.0.0.0:*               LISTEN      14265/redis-server 
tcp6       0      0 :::22                   :::*                    LISTEN      958/sshd 
AI 代码解读

3:


root@dubbo:/home/dubbo# ps -ef | grep gitlab
root       894     1  0 Jul11 ?        00:00:15 runsvdir -P /opt/gitlab/service log: ...........................................................................................................................................................................................................................................................................................................................................................................................................
root       906   902  0 Jul11 ?        00:00:00 svlogd -tt /var/log/gitlab/sidekiq
root       908   901  0 Jul11 ?        00:00:00 svlogd -tt /var/log/gitlab/nginx
root       910   899  0 Jul11 ?        00:00:00 svlogd -tt /var/log/gitlab/unicorn
root       911   898  0 Jul11 ?        00:00:02 svlogd -tt /var/log/gitlab/redis
root       915   903  0 Jul11 ?        00:00:00 svlogd -tt /var/log/gitlab/logrotate
root       917   900  0 Jul11 ?        00:00:00 svlogd -tt /var/log/gitlab/postgresql
root     14249   901  0 18:27 ?        00:00:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
gitlab-+ 14250 14249  0 18:27 ?        00:00:00 nginx: worker process                                   
gitlab-+ 14251 14249  0 18:27 ?        00:00:00 nginx: worker process                                   
gitlab-+ 14252 14249  0 18:27 ?        00:00:00 nginx: worker process                                   
gitlab-+ 14253 14249  0 18:27 ?        00:00:00 nginx: worker process                                   
gitlab-+ 14254 14249  0 18:27 ?        00:00:00 nginx: worker process                                   
gitlab-+ 14255 14249  0 18:27 ?        00:00:00 nginx: worker process                                   
gitlab-+ 14257   900  0 18:27 ?        00:00:00 /opt/gitlab/embedded/bin/postgres -D /var/opt/gitlab/postgresql/data
gitlab-+ 14259 14257  0 18:27 ?        00:00:00 postgres: checkpointer process                                      
gitlab-+ 14260 14257  0 18:27 ?        00:00:00 postgres: writer process                                            
gitlab-+ 14261 14257  0 18:27 ?        00:00:00 postgres: wal writer process                                        
gitlab-+ 14262 14257  0 18:27 ?        00:00:00 postgres: autovacuum launcher process                               
gitlab-+ 14263 14257  0 18:27 ?        00:00:00 postgres: stats collector process                                   
gitlab-+ 14265   898  0 18:27 ?        00:00:01 /opt/gitlab/embedded/bin/redis-server 127.0.0.1:0                     
git      14269   902  0 18:27 ?        00:00:12 sidekiq 3.3.0 gitlab-rails [0 of 25 busy]                                                                                                                                                                                                     
git      14288     1  0 18:27 ?        00:00:08 unicorn master -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru                                              
git      14349 14288  0 18:27 ?        00:00:00 unicorn worker[0] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru                                           
git      14352 14288  0 18:27 ?        00:00:00 unicorn worker[1] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru                                           
git      14355 14288  0 18:27 ?        00:00:00 unicorn worker[2] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru                                           
git      14358 14288  0 18:27 ?        00:00:00 unicorn worker[3] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru                                           
git      14361 14288  0 18:27 ?        00:00:00 unicorn worker[4] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru                                           
git      14364 14288  0 18:27 ?        00:00:00 unicorn worker[5] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru                                           
git      14367 14288  0 18:27 ?        00:00:00 unicorn worker[6] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru                                           
gitlab-+ 14377 14257  0 18:27 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle                   
gitlab-+ 14382 14257  0 18:27 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle                   
gitlab-+ 14385 14257  0 18:27 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle                   
gitlab-+ 14554 14257  0 18:28 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle                   
gitlab-+ 14753 14257  0 18:30 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle                   
root     16860 11942  0 19:05 pts/0    00:00:00 grep --color=auto gitlab
AI 代码解读





相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
打赏
0
0
0
1
4
分享
相关文章
在 Ubuntu 上安装 Nginx
在 Ubuntu 上安装和配置 Nginx 非常简单。首先更新系统包,然后通过 `apt` 安装 Nginx,检查服务状态并配置防火墙规则。访问服务器 IP 测试是否成功显示默认页面。还可管理服务、创建虚拟主机及排查常见问题,适合新手快速上手部署高性能 Web 服务。
291 0
在Ubuntu上安装MEAN Stack的4个步骤
本指南介绍了在Ubuntu上安装MEAN Stack的四个步骤。MEAN Stack是一种基于JavaScript的开发堆栈,包含MongoDB、ExpressJS、AngularJS和NodeJS。步骤包括:1. 更新系统并准备安装MEAN;2. 从官方源安装最新版MongoDB;3. 安装NodeJS、Git和NPM;4. 克隆mean.io仓库并使用NPM安装剩余依赖项。通过这些步骤,您可以快速搭建基于MEAN Stack的应用开发环境。
78 2
Ubuntu 安装 docker
本文介绍了在 Ubuntu 系统上安装 Docker 的详细步骤,包括卸载旧版本、设置 Docker 官方存储库、安装 Docker 包以及配置镜像源加速。首先通过移除旧版组件如 `docker.io` 和 `docker-compose` 等进行清理,然后添加官方 GPG 密钥并配置 APT 源,接着安装最新 Docker 组件。此外,还提供了阿里云和 1Panel 的镜像源配置方法以提升下载速度,并通过运行 `hello-world` 镜像测试安装是否成功。
895 3
Ubuntu 安装 docker
Loam在Ubuntu 18.04上的一站式安装指南
现在,你已经完成了Loam在Ubuntu 18.04上的一站式安装盛宴。从更新系统清洁,到搭建魔法环境的工作空间,再到召唤和激活Loam精髓的艺术——每步都妙不可言,每步都至关重要,让你在这场技术的饕餮盛宴中大显身手。
49 8
Go语言Web开发框架实践:使用 Gin 快速构建 Web 服务
Gin 是一个高效、轻量级的 Go 语言 Web 框架,支持中间件机制,非常适合开发 RESTful API。本文从安装到进阶技巧全面解析 Gin 的使用:快速入门示例(Hello Gin)、定义 RESTful 用户服务(增删改查接口实现),以及推荐实践如参数校验、中间件和路由分组等。通过对比标准库 `net/http`,Gin 提供更简洁灵活的开发体验。此外,还推荐了 GORM、Viper、Zap 等配合使用的工具库,助力高效开发。
Ubuntu环境下以源码编译方式安装Vim的步骤介绍
以上就是在Ubuntu环境下以源码编译方式安装Vim的全部步骤。就像煮一杯咖啡,虽然过程中需要耐心和一些技巧,但等到你熟悉之后,你会发现,不仅可以定制自己喜欢的口味,过程中的乐趣也是不能忽视的。希望你在编译安装Vim的过程中,能体验到这份乐趣。
129 21
在Ubuntu 20.04系统中安装SLAM库的具体操作步骤
以上是在Ubuntu 20.04系统中安装SLAM库的具体操作步骤。就像积木游戏,需要按照正确的步骤,适时地添加正确的部件,才能够构建出我们想要的积木模型。在现实操作中可能会遇到各种问题,就像积木构建中的各种困难,我们要有耐心和决心去解决它们,最后得到我们想要的结果。希望这个有趣的积木游戏比方能帮助你更好地理解SLAM库的安装过程,并在实际操作中得到应用。
97 34
在Jetson TX2的Ubuntu18.04系统中安装ROS的教程
所有这些步骤并不复杂,但确实需要仔细一点。如果遇到问题,不要灰心,问题是解决问题的开始。保持耐心,细心阅读错误信息,通常情况下,问题的答案就藏在其中。祝ROS旅程顺利!
92 18
|
3月前
|
Golang | Gin:net/http与Gin启动web服务的简单比较
总的来说,`net/http`和 `Gin`都是优秀的库,它们各有优缺点。你应该根据你的需求和经验来选择最适合你的工具。希望这个比较可以帮助你做出决策。
113 35
在Ubuntu 22.04上配置和安装MySQL
以上就是在Ubuntu 22.04上配置和安装MySQL的步骤。这个过程可能看起来有点复杂,但只要按照步骤一步步来,你会发现其实并不难。记住,任何时候都不要急于求成,耐心是解决问题的关键。
334 30
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等

登录插画

登录以查看您的控制台资源

管理云资源
状态一览
快捷访问