# Configure and install EPEL and the dependent environment
# Update a package
Yum update
Yum-y install wget
Yum-y -- nogpgcheck install http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
# Add an epel source
Http://www.cnblogs.com/Irving/p/3729074.html
# Install the required dependency package
Yum-y install readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel expat-devel db4-devel byacc sqlite-devel libyaml-devel libffi-devliblibxml2 libxml2-devel libxslt -devel libicu-devel system-config-firewall-tui python-devel redis wget crontabs logwatch logrotate perl-Time-HiRes git gettext-devel libel openssl-devel zlib-devel gcc- c ++ make autoconf readline-devel expat-devel gettext-devel tk-devel libxml2-devel libffi-devel libxslt-devel libicu-devel python-pip sqlite-devel patch libyaml * pcre-devel
# Install Ruby (domestic image of rubygems needs to be added)
Gem is a standard package for managing Ruby libraries and programs. It is very convenient to find, install, upgrade, and uninstall software packages through Ruby Gem (such as http://rubygems.org/) sources.
Yum-y install rubygems ruby
Gem sources -- remove https://rubygems.org/
Gem source-a http://ruby.taobao.org/
Gem sources-l
Gem install bundler -- no-ri -- no-rdoc
Ln-s/usr/local/bin/gem/usr/bin/gem
Ln-s/usr/local/bin/bundle/usr/bin/bundle
Ruby-v
# Install Git
Http://www.cnblogs.com/Irving/p/3729064.html
# Create a Git User for GitLab
Adduser -- comment 'gitlab 'git
Passwd git
# To facilitate adding git users with root permissions
Vi/etc/sudoers
Git ALL = (ALL) ALL
# Force save
: Wq!
# Set permissions (important)
Sudo chmod o + x/home/git
Vi/home/git/. bash_profile
Export GIT_SSL_NO_VERIFY = 1
Source/home/git/. bash_profile
# If no variable is added, the following error will be reported when you use the https link.
Fatal: unable to access 'https: // github.com/gitlabhq/grit.git/': Peer certificate cannot be authenticated with known CA certificates
# Install GitLab Shell
Su-git
Git clone https://gitlab.com/gitlab-org/gitlab-shell.git-B v1.9.3
Cd gitlab-shell/
Cp config. yml. example config. yml
Vi config. yml
# Configure gitlab domain name
Gitlab_url: "The http://git.test.com /"
# Gitlab uses https for access
Self_signed_cert: true
# Installation
./Bin/install
Create user 'gitlab '@ 'localhost' identified by '20140901 ';
# Install MYSQL
Su-
Yum install mariadb-devel
Chkconfig mysqld on
Service mysqld start
# Set the password of the mysql root account
/Usr/bin/mysql_secure_installation
Create a database for gitlab
Mysql-u root-p
# Create a user
Create user 'gitlab '@ 'localhost' identified by 'gitlab login password ';
# Creating a database
Create database if not exists 'gitlabhq _ production 'default character set 'utf8' COLLATE 'utf8 _ unicode_ci ';
# Set permissions
Grant select, lock tables, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, alter on 'gitlabhq _ production '. * TO 'gitlab' @ 'localhost ';
Quit
# Install GitLab
Su-git
Git clone https://gitlab.com/gitlab-org/gitlab-ce.git-B 6-8-stable gitlab
Cd gitlab
# Copy the configuration file
Cp config/gitlab. yml. example config/gitlab. yml
# Modifying the access domain name
Vi config/gitlab. yml
# Web server settings
Host: git.test.com
Port: 80
Https: true
# Configure permissions
Chown-R git log/
Chown-R git tmp/
Chmod-R u + rwX log/
Chmod-R u + rwX tmp/
Mkdir tmp/pids/
Mkdir tmp/sockets/
Chmod-R u + rwX tmp/pids/
Chmod-R u + rwX tmp/sockets/
Mkdir public/uploads
Chmod-R u + rwX public/uploads
Cp config/unicorn. rb. example config/unicorn. rb
Cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
# Configure git users and emails
Git config -- global user. name "GitLab"
Git config -- global user. email "[email protected]"
Git config -- global core. autocrlf input
# Configure the gitlab Database
Cp config/database. yml. mysql config/database. yml
Vi config/database. yml
Production:
Adapter: mysql2
Encoding: utf8
Reconnect: false
Database: gitlabhq_production
Pool: 5
Username: gitlab
Password: "gitlab"
# Host: localhost
# Socket:/tmp/mysql. sock
# Install gems
Su-
$ Gem install charlock_holmes -- version '0. 6.9.4'
Vi Gemfile
Source "https://rubygems.org" to source "http://rubygems.org" or change
# Installation
Bundle install -- deployment -- without development test IPVs puma aws
# Start the redis service
Sudo/etc/init. d/redis start
Sudo chkconfig redis on
# Initializing a database
Bundle exec rake gitlab: setup RAILS_ENV = production
# Default account and password
Administrator account created:
[Email protected]
Password... 5 iveL! Fe
# Install the startup script
Sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/init/sysvinit/centos/gitlab-unicorn-P/etc/init. d/
Sudo mv/etc/init. d/gitlab-unicorn/etc/init. d/gitlab
Sudo chmod + x/etc/init. d/gitlab
Sudo chkconfig -- add gitlab
Sudo chkconfig gitlab on
Sudo/etc/init. d/gitlab start
# Pulling GitLab static files
Cd/home/git/gitlab
Bundle exec rake assets: precompile RAILS_ENV = production
# Check application status
Bundle exec rake gitlab: env: info RAILS_ENV = production
# Install Nginx
# Installation
Su-
Yum-y install nginx
Chkconfig nginx on
# Copy gitlab configurations
Cp/home/git/gitlab/lib/support/nginx/gitlab/etc/nginx/conf. d/
# Backup default configuration
Mv/etc/nginx/conf. d/default. conf/etc/nginx/conf. d/default. conf. back
# Re-cover the default configuration (or delete the default. conf default configuration, only gitlab is used)
Mv/etc/nginx/conf. d/gitlab/etc/nginx/conf. d/default. conf
# Start the service
# Service gitlab start (restart)
# Service nginx start (restart)
# Disable the firewall (it will take effect permanently after restart)
Service iptables stop
Chkconfig iptables off
# Access services
Http: // 192.168.0.107/
I have encountered the following problems:
1. The latest ruby source code cannot be compiled for a long time. Change to a lower version.
2.502 error. Because Nginx is configured with 502 error by default, view Nginx log/var/log/nginx/gitlab_error.log
"/Home/git/gitlab/public/favicon.ico.html" failed (13: Permission denied), client: 33.33.33.1, server: gitlab. web. lo, request: "GET/favicon. ico HTTP/1.1 & quot"
I thought it was a problem with the Socet service and found that it was a Permission problem.
Solution: chmod o + x/home/git
Refer:
Work with Gitlab
Http://feiyang.me/2013/03/work-with-gitlab/
Replace Unicorn and run Gitlab
Http://icyleaf.com/2014/01/moving-unicorn-to-puma-on-gitlab/
GitLab enables HTTPS
Http://blog.csdn.net/csfreebird/article/details/8579488
Ubuntu
Http://my.oschina.net/guol/blog/165409
Http://rfyiamcool.blog.51cto.com/1030776/1365521/
Redhat
Http://my.oschina.net/xiaokaceng/blog/187573
CentOS
Http://my.oschina.net/wzlee/blog/262181
Http://hypocritical.blog.51cto.com/3388028/1405574
Install gitlab on centos 7