Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Gitlab installation under CentOS 7     - How to use the Vault secure password storage and API key (Linux)

- The Zabbix2.4.5 source compiler installation under Ubuntu 14.04 (Server)

- Using Java to build micro-services (Server)

- SELinux security permissions HTTP + PHP service changes (Server)

- imp / exp Oracle Database import and export commands (Database)

- LAN in Ubuntu shared folders to Windows (Linux)

- using Docker Kitematic on windows (Linux)

- How to Debian Linux the default Python version switch to alternative version (Linux)

- Hadoop 2.0 Detailed Configuration Tutorial (Server)

- Oracle SQL statement to retrieve data paging table (Database)

- Oracle Migration partition table (Database)

- Use Linux firewall camouflage defense hacked (Linux)

- Realize screen recording and playback via Linux command (Linux)

- Ubuntu 14.04 next upgrade to GNOME 3.12 (Linux)

- installation of Vim plugin YouCompleteMe under Ubuntu 15.04 (Linux)

- C # how to generate a folder or file automatically rename (Programming)

- CentOS 6 kernel upgrade to Kernel 3.x (Linux)

- Oracle partition table data migration, process management automation (Database)

- installation and configuration of the PHP environment (Apache2) under Linux (Server)

- How to install Virtualbox 4.3.20 in Ubuntu 14.04 (Linux)

 
         
  Gitlab installation under CentOS 7
     
  Add Date : 2018-11-21      
         
         
         
  GitLab, is a use of Ruby on Rails development of open source applications to achieve a self-hosted Git repository project, accessible public or private projects through a Web interface.

It has similar features with Github, you can browse the source code, management deficiencies and comments. The management team can access to the repository, it is very easy to navigate and offers submitted version history of a document library. Team members can use the built-in simple chat program (Wall) to communicate. It also provides a snippet collection functions can easily achieve code reuse easy when there is a need in the future to find out.

Open source projects address: https: //github.com/gitlabhq/gitlabhq

installation steps

1, to provide some package must provide epel, turn off the firewall and selinux and other operations;

2, gitlab more dependent python function, you need to upgrade to python 2.7.X;

3, install redis memory database;

4, install MySQL relational database;

5, to provide environmental support gitlab of ruby;

6, to provide gitlab-shell to manage the git repository;

7, the installation gitlab system;

8, install nginx web service, to do the reverse proxy.

First, install the extended source and dependencies

# Install extensions source
rpm -ivh epel-release-7-5.noarch.rpm # modify /etc/yum.repo.d/epel.repo
# Increase puias source
wget -O /etc/yum.repos.d/PUIAS_6_computational.repo
wget -O / etc / pki / rpm-gpg / RPM-GPG-KEY-puias http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias
rpm --import / etc / pki / rpm-gpg / RPM-GPG-KEY-puias
# Verify successful
rpm -qa gpg *

See warehouse source

yum repolist
It is loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * PUIAS_6_computational: www.puias.princeton.edu
 * Epel: ftp.sjtu.edu.cn
Warehouse Warehouse identifies the name of the state
PUIAS_6_computational PUIAS computational Base 6 - x86_64 2,638
base CentOS-6 - Base - 163.com 6,518
* Epel Extra Packages for Enterprise Linux 6 - x86_64 11,148
extras CentOS-6 - Extras - 163.com 36
updates CentOS-6 - Updates - 163.com 727
repolist: 21,067

If this list does not epel and PUIAS_6_computational, execute the following command

yum-config-manager --enable epel --enable PUIAS_6_computational

Second, the installation dependencies

yum -y update
yum -y groupinstall 'Development Tools'
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 libcom_err-devel

Third, install Git

yum -y remove git
yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel
mkdir / tmp / git && cd / tmp / git
wget
tar zxvf git-2.6.0.tar.gz
cd git-2.6.0
./configure --prefix = / usr / local
make && make install

Verify Git

git --version

Fourth, the installation Ruby

yum -y remove ruby
cd / tmp / git
wget
tar zxvf ruby-2.2.3.tar.gz
cd ruby-2.2.3
 ./configure --prefix = / usr / local / ruby --disable-install-rdoc
 make && make install

Verify Ruby

ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

Modify RubyGames mirror Taobao, increase download speed

  vim / home / git / gitlab / Gemfile
  source "# replace Taobao

Install bundler

gem install bundler --no-doc

Fifth, create a system user

adduser --system --shell / bin / bash --comment 'GitLab' --create-home --home-dir / home / git / git

Sixth, modify sudo file, allowing users to use sudo git

visudo
Defaults secure_path = / sbin: / bin: / usr / sbin: / usr / bin: / usr / local / bin # replace this
# Add a line under the root ALL = (ALL) ALL
  git ALL = (ALL) ALL

Seven, install MySQL

# Uninstall CentOS7 comes MaraiaDB
rpm -qa | grep maraiadb
yum -y remove maraiadb
# Install dependencies
yum -y install make gcc-c ++ cmake bison-devel ncurses-devel
# Download MySQL
cd / tmp / git
wget wget
tar zxvf mysql-5.6.20.tar.gz
cd /mysql-5.6.20
# Compile MySQL
cmake \
-DCMAKE_INSTALL_PREFIX = / Usr / local / mysql \
-DMYSQL_DATADIR = / Usr / local / mysql / data \
-DSYSCONFDIR = / Etc \
-DWITH_MYISAM_STORAGE_ENGINE = 1 \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_MEMORY_STORAGE_ENGINE = 1 \
-DWITH_READLINE = 1 \
-DMYSQL_UNIX_ADDR = / Var / lib / mysql / mysql.sock \
-DMYSQL_TCP_PORT = 3306 \
-DENABLED_LOCAL_INFILE = 1 \
-DWITH_PARTITION_STORAGE_ENGINE = 1 \
-DEXTRA_CHARSETS = All \
-DDEFAULT_CHARSET = Utf8 \
-DDEFAULT_COLLATION = Utf8_general_ci
#installation
make && make install
# Configure MySQL user
groupadd mysql
useradd -g mysql mysql
# Modify / usr / local / mysql
chown -R mysql: mysql / usr / local / mysql
# Initialize MySQL
cd / usr / local / mysql
# Execute initialization script
scripts / mysql_install_db --basedir = / usr / local / mysql --datadir = / usr / local / mysql / data --user = mysql
# Add service, set boot
cp support-files / mysql.server /etc/init.d/mysql
chkconfig mysql on
service mysql start - start MySQL
# Configuration Variables
vim / etc / profile
  PATH = / usr / local / mysql / bin: $ PATH
  export PATH
source / etc / profile

Create a database, and the database user and authorization

mysql -u root -p
mysql> CREATE USER 'git' @ 'localhost' IDENTIFIED BY '123.com';
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET` utf8` COLLATE `utf8_unicode_ci`;
. Mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production` * TO 'git' @ 'localhost';

Test success landing

mysql -ugit -p123.com -D gitlabhq_production

Eight, configure Redis

chkconfig redis on
  
cp /etc/redis.conf /etc/redis.conf.orig
  
# Modify the listening port
sed 's / ^ port * / port 0 /.' /etc/redis.conf.orig | tee /etc/redis.conf
  
# Add content
echo 'unixsocket /var/run/redis/redis.sock' | tee -a /etc/redis.conf
  
echo -e 'unixsocketperm 0770' | tee -a /etc/redis.conf

Create a directory to change permissions

mkdir / var / run / redis
  
chown redis: redis / var / run / redis
  
chmod 755 / var / run / redis

Start Service

service redis restart

Add git to redis group

usermod -aG redis git

Nine, installation GitLab

cd / home / git
  
Download Source #
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 7-4-stable gitlab

Modify the configuration

cd gitLab /
  
sudo -u git -H cp config / gitlab.yml.example config / gitlab.yml
  
sudo -u git -H vim config / gitlab.yml
gitlab:
    ## Web server settings (note: host is the FQDN, do not include http: //)
    host: localhost
    port: 80
    https: false

Modify directory permissions

chown -R git log /
chown -R git tmp /
chmod -R u + rwX log /
chmod -R u + rwX tmp /
chmod -R u + rwX tmp / pids /
chmod -R u + rwX tmp / sockets /
chmod -R u + rwX public / uploads

Create a directory

sudo -u git -H mkdir / home / git / gitlab-satellites
chmod u + rwx, g = rx, o-rwx / home / git / gitlab-satellites

Edit the configuration file unicorn.rb

sudo -u git -H cp config / unicorn.rb.example config / unicorn.rb
  
# Display the number of cores
nproc
1
  
# Edit Configuration
sudo -u git -H vim config / unicorn.rb
worker_processes 1

Copy the configuration file

sudo -u git -H cp config / initializers / rack_attack.rb.example config / initializers / rack_attack.rb

Define global users and mailboxes

sudo -u git -H git config --global user.name "GitLab"
sudo -u git -H git config --global user.email "example@example.com"
sudo -u git -H git config --global core.autocrlf input

Edit Connection configuration redis

# Copy the configuration
sudo -u git -H cp config / resque.yml.example config / resque.yml
  
# Redis connection configuration, the default configuration, unmodified
sudo -u git -H vim config / resque.yml

X. GitLab database configuration file

sudo -u git cp config / database.yml.mysql config / database.yml
  
# Edit the configuration file
sudo -u git -H vim config / database.yml
production:
  adapter: mysql2
  encoding: utf8
  collation: utf8_general_ci
  reconnect: false
  database: gitlabhq_production
  pool: 10
  username: git
  password: "gitpwd"
  host: localhost
  socket: /var/lib/mysql/mysql.sock
  
# Modify file permissions, user-readable only git
sudo -u git -H chmod o-rwx config / database.yml

XI installed gem

cd / home / git / gitLab
  
sudo -u git -H bundle install --deployment --without development test postgres aws

XII installation GitLab-shell

sudo -u git -H bundle exec rake gitlab: shell: install [v2.0.1] REDIS_URL = unix: /var/run/redis/redis.sock RAILS_ENV = production
# Edit Configuration
sudo -u git -H vim /home/git/gitlab-shell/config.yml
---
user: git
gitlab_url: https: // localhost /
http_settings:
  self_signed_cert: true
repos_path: "/ home / git / repositories /"
auth_file: "/home/git/.ssh/authorized_keys"
redis:
  bin: "/ usr / bin / redis-cli"
  namespace: resque: gitlab
  socket: "/var/run/redis/redis.sock"
log_level: INFO
audit_usernames: false

XIII, initialize the database

sudo -u git -H bundle exec rake gitlab: setup RAILS_ENV = production

XIV script download service

wget -O /etc/init.d/gitlab
chmod + x /etc/init.d/gitlab
  
chkconfig --add gitlab
  
chkconfig gitlab on
  
# Set logrotate
cp lib / support / logrotate / gitlab /etc/logrotate.d/gitlab
  
# Detection application state
sudo -u git -H bundle exec rake gitlab: env: info RAILS_ENV = production
  
sudo -u git -H bundle exec rake assets: precompile RAILS_ENV = production
 
# To bin / web bin / background_jobs Directory Permissions
chmod 755 / home / git / gitlab / bin / web
 
chmod 755 / home / git / gitlab / bin / background_jobs
  
# Start Service
service gitlab start

Fifth, configure Web Services

I am using nginx #
yum -y install nginx
  
chkconfig nginx on
  
wget -O /etc/nginx/conf.d/gitlab.conf https://gitlab.com/gitlab-org/gitlab-ce/raw/master/lib/support/nginx/gitlab-ssl

Add to git group nginx

usermod -a -G git nginx
  
chmod g + rx / home / git /

Modify the configuration, modify server_name

1
2
3
4
5
6 vim /etc/nginx/conf.d/gitlab.conf
 # Two server_name If no domain name, change your IP address
 
# Comment nginx.conf the monitor port, or start behind nginx, will complain
 vim /etc/nginx/nginx.conf
  listen [::]: 80 default_server; commented

Adding SSL

mkdir / etc / nginx / ssl
 
Executive openssl req -newkey rsa: 2048 -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key # just fill in on the line, the last generation gitlab.crt gitlab.key
 
cp gitlab.crt gitlab.key / etc / nginx / ssl

Start nginx service

service nginx start
     
         
         
         
  More:      
 
- iOS in the event delivery and the responder chain (Programming)
- MySQL Online DDL tools of pt-online-schema-change (Database)
- LVM basic concepts, management (Linux)
- configuration ssh without password under Linux (Linux)
- Each catalog Detailed Linux (Linux)
- stat Usage: Get permission to file the corresponding figures (Linux)
- To help you easily protect the Linux System (Linux)
- Talk about Java EE Learning (Programming)
- Java implementation chain store binary search tree (recursive method) (Programming)
- Linux file system (inode and block) (Linux)
- Linux system security settings after installation (Linux)
- Linux how to view your JDK installation (Linux)
- CentOS source installation GitLab Chinese Version (Server)
- Linux 4.0+ kernel support for hardware switching module (HW Switch Offload) (Linux)
- CentOS 7.1 install NTFS-3G (Linux)
- To install Spotify in Ubuntu / Mint (Linux)
- Systemd on RHEL7 (Linux)
- Use GNU / Linux broadcasting of television programs (Linux)
- Oracle 11g on Linux system boot from the startup settings (Database)
- To install the latest version of Shotwell 0.18 under Ubuntu (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.