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

本文涉及的产品
云原生内存数据库 Tair,内存型 2GB
云数据库 Redis 版,标准版 2GB
推荐场景:
搭建游戏排行榜
云原生数据库 PolarDB MySQL 版,通用型 2核4GB 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

2:下载gitlab安装包:


https://about.gitlab.com/downloads/archives/

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

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


sudo apt-get install openssh-server
sudo apt-get install postfix 


注:邮件选择: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


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"


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


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


sudo gitlab-ctl reconfigure

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

注:若状态都为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


8:检查GitLab的日志:


sudo gitlab-ctl tail

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

问题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.

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 

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





相关实践学习
基于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
目录
相关文章
|
9天前
|
监控 前端开发 数据库连接
Zabbix 5.0 LTS的web界面安装及修改zabbix web管理员的默认密码
这篇文章是关于如何安装Zabbix 5.0 LTS的web界面以及如何修改Zabbix web管理员默认密码的教程。
32 1
|
13天前
|
JSON 定位技术 数据格式
web GIS神器,一行命令快捷构建精灵图服务
web GIS神器,一行命令快捷构建精灵图服务
|
13天前
|
Shell Docker 容器
GitlabCI学习笔记之一:安装Gitlab和GitLabRunner
GitlabCI学习笔记之一:安装Gitlab和GitLabRunner
|
6天前
|
关系型数据库 Java MySQL
"解锁Java Web传奇之旅:从JDK1.8到Tomcat,再到MariaDB,一场跨越数据库的冒险安装盛宴,挑战你的技术极限!"
【9月更文挑战第6天】在Linux环境下安装JDK 1.8、Tomcat和MariaDB是搭建Java Web应用的关键步骤。本文详细介绍了使用apt-get安装OpenJDK 1.8、下载并配置Tomcat,以及安装和安全设置MariaDB(MySQL的开源分支)的方法。通过这些步骤,您可以快速构建一个稳定、高效的开发和部署环境,并验证各组件是否正确安装和运行。这为您的Java Web应用提供了一个坚实的基础。
17 0
|
10天前
|
Docker 容器
Docker安装Gitlab和Gitlab-Runner并实现项目CICD
Docker安装Gitlab和Gitlab-Runner并实现项目CICD
|
11天前
|
Java 缓存 数据库连接
揭秘!Struts 2性能翻倍的秘诀:不可思议的优化技巧大公开
【8月更文挑战第31天】《Struts 2性能优化技巧》介绍了提升Struts 2 Web应用响应速度的关键策略,包括减少配置开销、优化Action处理、合理使用拦截器、精简标签库使用、改进数据访问方式、利用缓存机制以及浏览器与网络层面的优化。通过实施这些技巧,如懒加载配置、异步请求处理、高效数据库连接管理和启用GZIP压缩等,可显著提高应用性能,为用户提供更快的体验。性能优化需根据实际场景持续调整。
35 0
|
11天前
|
Java 网络架构 数据格式
Struts 2 携手 RESTful:颠覆传统,重塑Web服务新纪元的史诗级组合!
【8月更文挑战第31天】《Struts 2 与 RESTful 设计:构建现代 Web 服务》介绍如何结合 Struts 2 框架与 RESTful 设计理念,构建高效、可扩展的 Web 服务。Struts 2 的 REST 插件提供简洁的 API 和约定,使开发者能快速创建符合 REST 规范的服务接口。通过在 `struts.xml` 中配置 `<rest>` 命名空间并使用注解如 `@Action`、`@GET` 等,可轻松定义服务路径及 HTTP 方法。
27 0
|
11天前
|
前端开发 API 开发者
JSF与RESTful服务的完美邂逅:如何打造符合现代Web潮流的数据交互新体验
【8月更文挑战第31天】随着互联网技术的发展,RESTful架构风格因其实现简便与无状态特性而在Web服务构建中日益流行。本文探讨如何结合JavaServer Faces (JSF) 和 JAX-RS 构建RESTful API,展示从前端到后端分离的完整解决方案。通过定义资源类、配置 `web.xml` 文件以及使用依赖注入等步骤,演示了在JSF项目中实现RESTful服务的具体过程,为Java开发者提供了实用指南。
23 0
|
11天前
|
JSON API 数据库
探索FastAPI:不仅仅是一个Python Web框架,更是助力开发者高效构建现代化RESTful API服务的神器——从环境搭建到CRUD应用实战全面解析
【8月更文挑战第31天】FastAPI 是一个基于 Python 3.6+ 类型提示标准的现代 Web 框架,以其高性能、易用性和现代化设计而备受青睐。本文通过示例介绍了 FastAPI 的优势及其在构建高效 Web 应用中的强大功能。首先,通过安装 FastAPI 和 Uvicorn 并创建简单的“Hello, World!”应用入门;接着展示了如何处理路径参数和查询参数,并利用类型提示进行数据验证和转换。
29 0
|
2月前
|
Devops 持续交付 开发工具
入职必会-开发环境搭建54-GitLab下载和安装
GitLab 是一个基于 web 的 Git 仓库管理工具,提供了代码托管、版本控制、协作开发、持续集成等功能,是一个综合的 DevOps 平台。用户可以使用 GitLab 托管他们的代码仓库,并利用其丰富的功能来管理和协作开发项目。 以下是 GitLab 的一些主要特点和功能。
入职必会-开发环境搭建54-GitLab下载和安装