[关闭]
@cyysu 2017-09-27T06:24:17.000000Z 字数 14683 阅读 1148

gitlab搭建


环境搭建


作为本博客的第一次的,也同时作为对网络上博客的抄袭而不加以注意做一次贡献,就网络上源码安装Gitlab教程不多,并且很坑,特此整理一份。还请大家持续关注我的博客,转载请注明出处。谢谢

   [来自]:(http://www.cyysu.cn "运维技术")

0.开篇的话

文章依赖
1. 官方博客
2. 配置网络yum仓库 提取密码ak1v
3. centos下安装gitlab
4. centos7下源码安装gitlab

出现错误解决方案依赖

1. 提示没有找不到 Specified 'mysql2'
2. bundle更换源问题
3. no tmp uploads folder yet

便捷安装

1. Bitnami安装
2. 安装工具 提取密码:xb4e

1.关闭SELINUX和iptables

  1. [root@localhost ~]# service iptables stop #关闭防火墙
  2. [root@localhost ~]# setenforce 0 #暂时关闭Selinux

2.添加EPEL存储库

  1. wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://getfedora.org/static/0608B895.txt
  2. rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
  3. #验证密钥安装成功
  4. rpm -qa gpg*
  5. #安装软件包,不区分32和64位
  6. rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

3.添加Remi的RPM存储库

  1. wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-remi http://rpms.famillecollet.com/RPM-GPG-KEY-remi
  2. rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
  3. ##验证密钥安装成功
  4. rpm -qa gpg*
  5. #安装软件包
  6. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  7. #查看上述仓库是否启动
  8. yum repolist
  9. repo id repo name status
  10. base CentOS-6 - Base 6696
  11. epel Extra Packages for Enterprise Linux 6 - x86_64 12125
  12. extras CentOS-6 - Extras 61
  13. remi-safe Safe Remi's RPM repository for Enterprise Linux 6 - x86_64 827
  14. updates CentOS-6 - Updates 137
  15. repolist: 19846

4.安装GitLab所需的工具

  1. yum -y update
  2. #安装需要的开发的工具
  3. yum -y groupinstall 'Development Tools'
  4. yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc 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 nodejs
  5. yum -y install python-docutils

5.安装邮件服务器

  1. #在这里自行可以自行去配置,官方推荐的是postfix。有机会的话,笔者会研究一下,后续更新上来博客
  2. yum install postfix
  3. service postfix restart
  4. chkconfig postfix on
  5. #修改postfix的主配置文件
  6. vim /etc/postfix/main.cf
  7. myhostname = sample.test.com  ← 设置系统的主机名
  8. mydomain = test.com  ← 设置域名(我们将让此处设置将成为E-mail地址“@”后面的部分)
  9. myorigin = $mydomain  ← 将发信地址“@”后面的部分设置为域名(非系统主机名)
  10. inet_interfaces = all  ← 接受来自所有网络的请求
  11. mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain  ← 指定发给本地邮件的域名
  12. home_mailbox = Maildir/  ← 指定用户邮箱目录
  13. #修改gitlab相关的配置文件 修改内容如下:
  14. vim /home/git/gitlab/config/gitlab.yml
  15. email_enabled: true
  16. email_from: root@cyysu.cn # 发件人的地址
  17. email_display_name: GitLabMaster # 显示的收件人昵称
  18. email_reply_to:
  19. #配置上面的hostname的时候要注意修改一个/etc/hosts文件
  20. vim /etc/hosts
  21. #生效
  22. hostname your_hostname
  23. #配置完成之后记得要重启服务
  24. /etc/init.d/postfix restart
  25. /etc/init.d/gitlab restart
  26. #检查是否配置成功,开启三个shell窗口
  27. tail -f /home/git/gitlab/log/*.log
  28. tail -f /var/log/maillog
  29. #执行命令进入测试
  30. bundle exec rails console production
  31. #接下来就变成下面的界面
  32. #输入以下命令
  33. :sendmail
  34. #显示配置
  35. ActionMailer::Base.smtp_settings
  36. #给自己邮箱发送测试文件
  37. #这里测试最好用163邮箱测试,QQ邮箱测试不是太好使
  38. Notify.test_email('cyysu@163.com', 'Hello World', 'This is a test message').deliver_now

6.源码安装git

  1. #必须要确定git的版本高于2.7.4或更高版本。如果系统安装了git那么需要卸载
  2. yum -y remove git
  3. #安装git编译需求的软件
  4. yum install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel
  5. #下载源码并安装
  6. mkdir /tmp/git && cd /tmp/git
  7. curl --progress https://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz | tar xz
  8. cd git-2.9.0
  9. ./configure
  10. make
  11. make prefix=/usr/local install

7.安装Ruby

  1. #删除旧的Ruby 1.8软件包(如果存在)。GitLab只支持Ruby 2.1版本系列
  2. yum remove ruby
  3. #下载并编译
  4. mkdir /tmp/ruby && cd /tmp/ruby
  5. curl --progress https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.9.tar.gz | tar xz
  6. cd ruby-2.1.9
  7. ./configure --disable-install-rdoc
  8. make
  9. make prefix=/usr/local install
  10. #安装Bundler Gem
  11. gem install bundler --no-doc
  12. # 检测信息,如果输出信息就代表没错
  13. which ruby
  14. ruby -v

8.安装Go

  1. #从GitLab 8.0开始,Git HTTP请求由gitlab-workhorse(以前称为gitlab-git-http-server)处理。这是一个在Go写的小守护进程。要安装gitlab-workhorse,我们需要一个Go编译器。
  2. yum install -y golang golang-bin golang-src

9.创建用户

  1. #Gitlab 创建一个用户
  2. adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git
  3. #修改sudoers文件
  4. visudo
  5. Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

10.安装数据库

  1. #官方推荐用PostgreSQL,这里我们用Mysql来安装
  2. #安装软件
  3. yum install -y mysql-server mysql-devel
  4. chkconfig mysqld on
  5. service mysqld start
  6. #这里Mysql的版本保持这个样子就可以,亲测可用
  7. mysql --version
  8. #mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
  9. #首先对数据库进行一下设置
  10. mysql_secure_installation
  11. #登陆系统
  12. mysql -u root -p
  13. #为gitlab创建用户
  14. CREATE USER 'git'@'localhost' IDENTIFIED BY 'your passwd';
  15. #添加InnoDB引擎
  16. SET storage_engine=INNODB;
  17. #下面先不创建Gitlab生产数据库,后面有个命令可以创建这里先不创建(不执行)
  18. #CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
  19. #授权
  20. GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER, LOCK TABLES, REFERENCES ON `gitlabhq_production`.* TO 'git'@'localhost';
  21. #退出数据库
  22. \q

11.安装Redis

  1. #Gitlab要求Redis版本不低于2.8,系统默认安装版本为2.4.1,卸载当前版本并采用remi源安装最新版本:
  2. #卸载当前redis:
  3. yum -y remove redis
  4. #采用remi源安装最新版本:
  5. yum --enablerepo=remi install redis
  6. #确保redis在启动时启动:
  7. chkconfig redis on
  8. #将redis配置为使用套接字:
  9. cp /etc/redis.conf /etc/redis.conf.orig
  10. #通过将'port'设置为0,禁止在TCP上侦听Redis:
  11. sed 's/^port .*/port 0/' /etc/redis.conf.orig | sudo tee /etc/redis.conf
  12. #为默认CentOS路径启用Redis套接字:
  13. echo 'unixsocket /var/run/redis/redis.sock' | sudo tee -a /etc/redis.conf
  14. echo -e 'unixsocketperm 0770' | sudo tee -a /etc/redis.conf
  15. #创建包含套接字的目录
  16. mkdir /var/run/redis
  17. chown redis:redis /var/run/redis
  18. chmod 755 /var/run/redis
  19. #保留包含套接字的目录(如果适用)
  20. if [ -d /etc/tmpfiles.d ]; then
  21. echo 'd /var/run/redis 0755 redis redis 10d -' | sudo tee -a /etc/tmpfiles.d/redis.conf
  22. fi
  23. #修改配置文件
  24. vim /etc/redis.conf
  25. #bind 127.0.0.1
  26. #重启服务:
  27. service redis restart
  28. #如果遇到以下问题
  29. #>>> 'vm-enabled no'
  30. #Bad directive or wrong number of arguments
  31. [FAILED]
  32. 只需要注释以下内容:
  33. #vm-enabled yes
  34. #vm-swap-file /tmp/redis.swap
  35. #vm-max-memory 0
  36. #vm-page-size 32
  37. #vm-pages 134217728
  38. #vm-max-threads 4
  39. #hash-max-zipmap-entries 512
  40. #hash-max-zipmap-value 64
  41. #将git添加到redis组:
  42. usermod -aG redis git

12.安装Gitlab

  1. #存放gitlab等相关软件集合
  2. cd /home/git
  3. #下载
  4. sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 8-9-stable gitlab
  5. #配置,从这里开始直接复制即可,主要就是创建目录,赋予权限
  6. # Go to GitLab installation folder
  7. cd /home/git/gitlab
  8. # Copy the example GitLab config
  9. sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
  10. # Update GitLab config file, follow the directions at top of file
  11. sudo -u git -H editor config/gitlab.yml
  12. # Copy the example secrets file
  13. sudo -u git -H cp config/secrets.yml.example config/secrets.yml
  14. sudo -u git -H chmod 0600 config/secrets.yml
  15. # Make sure GitLab can write to the log/ and tmp/ directories
  16. sudo chown -R git log/
  17. sudo chown -R git tmp/
  18. sudo chmod -R u+rwX,go-w log/
  19. sudo chmod -R u+rwX tmp/
  20. # Make sure GitLab can write to the tmp/pids/ and tmp/sockets/ directories
  21. sudo chmod -R u+rwX tmp/pids/
  22. sudo chmod -R u+rwX tmp/sockets/
  23. # Create the public/uploads/ directory
  24. sudo -u git -H mkdir public/uploads/
  25. # Make sure only the GitLab user has access to the public/uploads/ directory
  26. # now that files in public/uploads are served by gitlab-workhorse
  27. sudo chmod 0700 public/uploads
  28. sudo chmod ug+rwX,o-rwx /home/git/repositories/
  29. # Change the permissions of the directory where CI build traces are stored
  30. sudo chmod -R u+rwX builds/
  31. # Change the permissions of the directory where CI artifacts are stored
  32. sudo chmod -R u+rwX shared/artifacts/
  33. # Copy the example Unicorn config
  34. sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
  35. # 查看核心数
  36. nproc
  37. # Enable cluster mode if you expect to have a high load instance
  38. # Ex. change amount of workers to 3 for 2GB RAM server
  39. # Set the number of workers to at least the number of cores
  40. sudo -u git -H editor config/unicorn.rb
  41. # Copy the example Rack attack config
  42. sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
  43. # Configure Git global settings for git user
  44. # 'autocrlf' is needed for the web editor
  45. sudo -u git -H git config --global core.autocrlf input
  46. # Disable 'git gc --auto' because GitLab already runs 'git gc' when needed
  47. sudo -u git -H git config --global gc.auto 0
  48. # Configure Redis connection settings
  49. sudo -u git -H cp config/resque.yml.example config/resque.yml
  50. # 这里保持默认
  51. sudo -u git -H vim config/resque.yml

13.数据库配置

  1. #配置数据库文件
  2. sudo -u git cp config/database.yml.mysql config/database.yml
  3. #编辑数据库文件
  4. sudo -u git -H vim config/database.yml
  5. production:
  6. adapter: mysql2
  7. encoding: utf8
  8. collation: utf8_general_ci
  9. reconnect: false
  10. database: gitlabhq_production
  11. pool: 10
  12. username: gitlab
  13. password: "gitlab"
  14. # host: localhost
  15. # socket: /tmp/mysql.sock
  16. #赋予权限
  17. sudo -u git -H chmod o-rwx config/database.yml

14.安装Gems

  1. cd /home/git/gitlab
  2. sudo -u git -H bundle config build.pg --with-pg-config=/usr/pgsql-9.3/bin/pg_config
  3. sudo -u git -H bundle install --deployment --without development test mysql aws kerberos
  4. sudo -u git -H bundle install --deployment --without development test postgres aws kerberos
  5. #提示出现这个错误:
  6. #Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
  7. #/usr/local/bin/ruby extconf.rb --with-pg-config=/usr/pgsql-9.3/bin/pg_config
  8. #Using config values from /usr/pgsql-9.3/bin/pg_config
  9. #sh: /usr/pgsql-9.3/bin/pg_config: No such file or directory
  10. #sh: /usr/pgsql-9.3/bin/pg_config: No such file or directory
  11. #解决方法:
  12. #卸载
  13. yum remove postgresql
  14. #安装pgdg仓库:
  15. rpm -Uvh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-2.noarch.rpm
  16. #安装postgresql93-server,postgreqsql93-devel和postgresql93-contrib库:
  17. yum install postgresql93-server postgresql93-devel postgresql93-contrib
  18. #重命名服务脚本:
  19. mv /etc/init.d/{postgresql-9.3,postgresql}
  20. # 服务启动
  21. service postgresql initdb
  22. service postgresql start
  23. chkconfig postgresql on
  24. #这个时候就不会报错了,提示以下信息
  25. #-------------------------------------------------
  26. #Thank you for installing html-pipeline!
  27. #You must bundle Filter gem dependencies.
  28. #See html-pipeline README.md for more details.
  29. #https://github.com/jch/html-pipeline#dependencies
  30. #-------------------------------------------------
  31. #这里我们修改一个Gemfile文件,刚刚编辑的数据库配置文件我们看到了Mysql2,我们执行的上述步骤是没有安装的,检查的方法可以使用如下
  32. #查看mysql2是否安装
  33. bundle show mysql2
  34. #当前目录在Gitlab目录下,编辑Gemfile文件,修改成如下内容
  35. vim Gemfile
  36. gem "mysql2", '~> 0.3.18'
  37. #在执行以下语句
  38. bundle install --no-deployment
  39. #执行时间根据网速和电脑配置而言,下面查看以下结果
  40. [root@localhost gitlab]# bundle show mysql2
  41. /usr/local/lib/ruby/gems/2.1.0/gems/mysql2-0.3.20

15.安装GitLab Shell

  1. #安装
  2. sudo -u git -H bundle exec rake gitlab:shell:install[v3.0.0] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
  3. #编辑文件 这个文件主要就是提供gitlab API 接口的
  4. sudo -u git -H vim /home/git/gitlab-shell/config.yml
  5. #修改内容如下
  6. gitlab_url: "http://localhost:8000/"
  7. #这个文件主要提供ruby的服务端口和ip
  8. [root@localhost gitlab]# vim config/unicorn.rb
  9. #修改内容如下
  10. listen "127.0.0.1:8080", :tcp_nopush => true
  11. #这个文件主要提供gitlab服务的端口,ip
  12. [root@localhost gitlab]# vim config/gitlab.yml
  13. #修改内容如下
  14. gitlab:
  15. host: localhost
  16. port: 8000
  17. git:
  18. bin_path: /usr/local/bin/git
  19. #如果后面的操作会提示git找不到那么需要执行以下操作
  20. ln -s /usr/local/bin/git /usr/bin/git
  21. restorecon -Rv /home/git/.ssh

16.安装gitlab-workhorse

  1. #这个不多说了,很简单
  2. cd /home/git
  3. sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git
  4. cd gitlab-workhorse
  5. sudo -u git -H git checkout v0.7.5
  6. sudo -u git -H make

17.初始化数据库

  1. cd /home/git/gitlab
  2. sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
  3. #这里会提示如下“错误”
  4. #Couldn't drop gitlabhq_production
  5. #Access denied for user 'gitlab'@'localhost' (using password: YES)Please provide the root password for your MySQL installation
  6. >输入你设定的mysql密码
  7. #之后就会提示如下内容
  8. # -> 0.0104s
  9. #-- add_foreign_key("u2f_registrations", "users")
  10. # -> 0.0085s
  11. #-- initialize_schema_migrations_table()
  12. # -> 0.0188s
  13. #Adding limits to schema.rb for mysql
  14. #-- change_column(:merge_request_diffs, :st_commits, :text, {:limit=>2147483647})
  15. # -> 0.0218s
  16. #-- change_column(:merge_request_diffs, :st_diffs, :text, {:limit=>2147483647})
  17. # -> 0.0107s
  18. #-- change_column(:snippets, :content, :text, {:limit=>2147483647})
  19. # -> 0.0134s
  20. #-- change_column(:notes, :st_diff, :text, {:limit=>2147483647})
  21. # -> 0.0149s
  22. #-- change_column(:events, :data, :text, {:limit=>2147483647})
  23. # -> 0.0096s
  24. #== Seed from /home/git/gitlab/db/fixtures/production/001_admin.rb
  25. #Administrator account created:
  26. #login: root
  27. #password: You'll be prompted to create one on your first visit.
  28. #当你进行登陆的时候就会提示你更改密码的操作

18.安装启动脚本

  1. #安装了这么长时间终于快结束了,心情有没有开心!!!!
  2. #当前目录在/home/git/gitlab
  3. cp lib/support/init.d/gitlab /etc/init.d/gitlab
  4. chkconfig gitlab on
  5. cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
  6. #检查程序的版本
  7. #System information
  8. #System: CentOS 6.8
  9. #Current User: git
  10. #Using RVM: no
  11. #Ruby Version: 2.1.9p490
  12. #Bundler Version:1.14.6
  13. #Rake Version: 10.5.0
  14. #Sidekiq Version:4.1.2
  15. #GitLab information
  16. #Version: 8.9.11
  17. #Revision: 9a05855
  18. #Directory: /home/git/gitlab
  19. #DB Adapter: mysql2
  20. #URL: http://localhost:8000
  21. #HTTP Clone URL: http://localhost:8000/some-group/some-project.git
  22. #SSH Clone URL: git@localhost:some-group/some-project.git
  23. #Using LDAP: no
  24. #Using Omniauth: no
  25. #GitLab Shell
  26. #Version: 3.0.0
  27. #Repositories: /home/git/repositories/
  28. #Hooks: /home/git/gitlab-shell/hooks/
  29. #Git: /usr/bin/git
  30. #生成网页需要的资源
  31. sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
  32. #启动实例
  33. service gitlab start
  34. #如果看到以下信息,就代表你已经成功安装了Gitlab
  35. #Starting GitLab Unicorn
  36. #Starting GitLab Sidekiq
  37. #Starting Gi充电tLab Workhorse
  38. #The GitLab Unicorn web server with pid 80821 is running.
  39. #The GitLab Sidekiq job dispatcher with pid 80870 is running.
  40. #The GitLab Workhorse with pid 80852 is running.
  41. #GitLab and all its components are up and running.
  42. #下面在浏览器开始c访问
  43. http://localhost:8000
  44. #开始就会弹出让你修改密码的界面,之后就提示登陆界面
  45. #http://localhost:8000/users/password/edit?reset_password_token=DjzQ-AcPsgdkhx4ckUBg
  46. #初始的时候你可以用root和你刚刚设定的密码进行登陆
  47. #http://localhost:8000/users/sign_in
  48. #如果发现不能登陆,请确保服务启动成功,然后在重点检查以下配置文件
  49. #当前目录 /home/git/gitlab
  50. vim config/gitlab.yml
  51. vim config/unicorn.rb
  52. vim ../gitlab-shell/config.yml
  53. #如果提示以下信息,那么需要检测Redis,mysql是否启动
  54. /etc/init.d/gitlab restart
  55. The GitLab Unicorn web server is not running.
  56. #查看/home/git/gitlab/log/unicorn.stderr.log,最新的日志在末尾。
  57. /home/git/gitlab/config/environments/production.rb:82: syntax error
  58. #进入命令模式set nu显示行号,找到82行所在。
  59. #如果发现启动不了服务,可以尝试重新创建一下数据库
  60. sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
  61. #检测一下程序状态
  62. #这里可以看出你的版本是否达到要求,不过笔者一切比较正常。
  63. #前几次装的时候出现过版本不对,不过也没有影响使用
  64. #可能这是个bug吧 如果那位大神了解这个还请给我留言,谢谢
  65. sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
  66. #Checking GitLab Shell ...
  67. #
  68. #GitLab Shell version >= 3.0.0 ? ... OK (3.0.0)
  69. #Repo base directory exists? ... yes
  70. #Repo base directory is a symlink? ... no
  71. #Repo base owned by git:git? ... yes
  72. #Repo base access is drwxrws---? ... yes
  73. #hooks directories in repos are links: ... can't check, you have no projects
  74. #Running /home/git/gitlab-shell/bin/check
  75. #Check GitLab API access: OK
  76. #Check directories and files:
  77. # /home/git/repositories/: OK
  78. # /home/git/.ssh/authorized_keys: OK
  79. #Send ping to redis server: gitlab-shell self-check successful
  80. #
  81. #Checking GitLab Shell ... Finished
  82. #
  83. #Checking Sidekiq ...
  84. #
  85. #Running? ... yes
  86. #Number of Sidekiq processes ... 1
  87. #
  88. #Checking Sidekiq ... Finished
  89. #
  90. #Checking Reply by email ...
  91. #
  92. #Reply by email is disabled in config/gitlab.yml
  93. #
  94. #Checking Reply by email ... Finished
  95. #
  96. #Checking LDAP ...
  97. #
  98. #LDAP is disabled in config/gitlab.yml
  99. #
  100. #Checking LDAP ... Finished
  101. #
  102. #Checking GitLab ...
  103. #
  104. #Git configured with autocrlf=input? ... yes
  105. #Database config exists? ... yes
  106. #All migrations up? ... yes
  107. #Database contains orphaned GroupMembers? ... no
  108. #GitLab config exists? ... yes
  109. #GitLab config outdated? ... no
  110. #Log directory writable? ... yes
  111. #Tmp directory writable? ... yes
  112. #Uploads directory setup correctly? ... skipped (no tmp uploads folder yet)
  113. #Init script exists? ... yes
  114. #Init script up-to-date? ... yes
  115. #projects have namespace: ... can't check, you have no projects
  116. #Redis version >= 2.8.0? ... yes
  117. #Ruby version >= 2.1.0 ? ... yes (2.1.9)
  118. #Your git bin path is "/usr/local/bin/git"
  119. #Git version >= 2.7.3 ? ... yes (2.9.0)
  120. #Active users: 1
  121. #
  122. #Checking GitLab ... Finished

19. Nginx服务器安装

  1. #说在前头: 这里的web服务器可以选择性安装,就是可以通过外网正常访问你的GitLab,这里web服务器可以选择Nginx或这Apache
  2. sudo yum install -y nginx
  3. sudo cp lib/support/nginx/gitlab /etc/nginx/conf.d/gitlab.conf
  4. #这里默认不修改端口 默认是80
  5. vim /etc/nginx/conf.d/gitlab.conf
  6. vim /etc/nginx/conf.d/default.conf
  7. vim /etc/nginx/nginx.conf
  8. #测试语法
  9. sudo nginx -t
  10. #启动服务
  11. sudo service nginx restart
  12. chkconfig nginx on
  13. sudo chmod 775 /home/git
  14. #在本地电脑访问对于的IP。如果以上均配置正确,就会看到登陆页面
  15. http://192.168.223.140:80
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注