安装gitlab服务器记录-精.

上传人:今*** 文档编号:105827752 上传时间:2019-10-13 格式:DOCX 页数:11 大小:187.85KB
返回 下载 相关 举报
安装gitlab服务器记录-精._第1页
第1页 / 共11页
安装gitlab服务器记录-精._第2页
第2页 / 共11页
安装gitlab服务器记录-精._第3页
第3页 / 共11页
安装gitlab服务器记录-精._第4页
第4页 / 共11页
安装gitlab服务器记录-精._第5页
第5页 / 共11页
点击查看更多>>
资源描述

《安装gitlab服务器记录-精.》由会员分享,可在线阅读,更多相关《安装gitlab服务器记录-精.(11页珍藏版)》请在金锄头文库上搜索。

1、安装gitlab安装内容:1、 系统依赖2、 Ruby3、 邮件代理服务器4、 创建系统用户5、 安装mysql6、 安装redis-server7、 安装gitlab8、 安装nginx9、 清除防火墙规则1、 安装系统环境依赖yum -y updateyum -y groupinstall Development Toolsyum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel by

2、acc sqlite-devel libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui redis sudo wget crontabs logwatch logrotate perl-Time-HiRes git cmake libcom_err-devel.i686 libcom_err-devel.x86_64【安装vim,并设置为默认编辑器】yum -y install vim

3、-enhanced #有vim编辑器可不执行yum -y install python-docutilsln -s /usr/bin/vim /usr/bin/editor2、 安装ruby【Ruby版本】:2.1.6 【版本要求】:2.1.xx,高于此版本安装其依赖包会有问题wget cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.6.tar.gzcd ruby-2.1.6./configure -disable-install-rdocmakemake prefix=/usr/local installgem source -r https:/rubyg

4、ems.org/gem source -a http:/rubygems.org/gem install bundler -no-doc3、 安装邮件代理服务器yum -y install postfix4、 创建系统用户【为gitlab创建用户】:adduser -system -shell /bin/bash -comment GitLab -create-home -home-dir /home/git/ git【修改配置文件,红色部分为新添加字段】visudoDefaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/

5、bin5、 安装mysql【mysql版本】:5.6.25,要求高于5.5.14【安装mysql】yum install -y mysql-server mysql-develchkconfig mysqld onservice mysqld startmysql -version【创建git账号的mysql信息】mysql -u root -pCREATE USER gitlocalhost IDENTIFIED BY $password;SET storage_engine=INNODB; #一般默认是innodb,因此命令不需要执行CREATE DATABASE IF NOT EXIST

6、S gitlabhq_production DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON gitlabhq_production.* TO gitlocalhost;q【测试成功与否】sudo -u git -H mysql -u git -p -D gitlabhq_production6、 安装redis如果不会安装,可以使用yum install redis=3.0.2【R

7、edis官网】:http:/redis.io/【Redis最新稳定版本】:3.0.2【安装并加入开机自启动】wget download.redis.io/releases/redis-3.0.2.tar.gztar zxvf redis-3.0.2.tar.gzcd redis-3.0.2makemake installmkdir /etc/rediscp redis.conf /etc/redis/redis.conf【更改配置文件】:/etc/redis/redis.conf,改成yesDaemonize yes【切换目录后,下载redis的启动脚本】:cdwget zxvf redis

8、.zipcd redismv redis /etc/init.d/redischmod +x /etc/init.d/redis/etc/init.d/redis start7、 安装gitlab【Gitlab源码下载】: https:/ /home/gitsudo -u git -H git clone https:/ -b 7-9-stable gitlabcd /home/git/gitlabsudo -u git -H cp config/gitlab.yml.example config/gitlab.ymlsudo -u git -H editor config/gitlab.ym

9、lchmod -R git +x /home/git/gitlab/bin/*chown -R git log/chown -R git tmp/chmod -R u+rwX log/chmod -R u+rwX tmp/sudo -u git -H mkdir /home/git/gitlab-satelliteschmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellitessudo -u git -H mkdir /home/git/gitlab-satelliteschmod u+rwx,g=rx,o-rwx /home/git/gitlab-sat

10、elliteschmod -R u+rwX public/uploadssudo -u git -H cp config/unicorn.rb.example config/unicorn.rbsudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rbsudo -u git -H cp config/resque.yml.example config/resque.ymlsudo -u git -H git config -global user.name Git

11、Labsudo -u git -H git config -global user.email gitlab_sudo -u git -H git config -global core.autocrlf inputsudo -u git cp config/database.yml.mysql config/database.ymlsudo -u git -H chmod o-rwx config/database.yml【修改配置文件】nproc #查看内核数,并修改unicorn.rbsudo -u git -H editor config/unicorn.rb修改config/data

12、base.yml,修改账号密码【安装gems】【修改文件配置】:/home/git/gitlab/Gemfile,改成如下图配置:sudo -u git -H bundle install -deployment -without development test postgres aws【修改配置文件】/home/git/gitlab/config/resque.yml,如果redis服务器有具体IP,将localhost修改为具体的IP即可:1:【安装gitlabshell】sudo -u git -H bundle exec rake gitlab:shell:installv2.1.0

13、 REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=productionsudo -u git -H editor /home/git/gitlab-shell/config.ymlrestorecon -Rv /home/git/.ssh【初始化数据库】sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=productionsudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PAS

14、SWORD=newpassword【初始化脚本】wget -O /etc/init.d/gitlab https:/ +x /etc/init.d/gitlabchkconfig -add gitlabchkconfig gitlab oncp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab【检测安装成功与否,并启动】sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=productionsudo -u git -H bundle exec rake assets:precompile RAILS_ENV=productionservice gitlab start8、 安装web服务器:nginx【Nginx版本号】:nginx-1.9.2【下载网址】

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号