installation on Ubuntu 14
Use the domestic installation source image to speed up the installation. Modify /etc/apt/sources.list.d/gitlab-ce.list and add the following lines
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/debian jessie main
start installation:
# install dependencies sudo apt-get install curl openssh-server ca-certificates postfix # Install GitLab Community Edition apt-get install gitlab-ce # Initialize, start GitLab automatically after initialization sudo gitlab-ctl reconfigure
Install on CentOS 6
Use domestic mirror installation, create a new /etc/yum.repos.d/gitlab-ce.repo, and add the following content
[gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6 repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=https://packages.gitlab.com/gpg.key
installation steps:
# install dependencies sudo yum install curl openssh-server openssh-clients postfix cronie # Start postfix mail service sudo service postfix start # check postfix sudo chkconfig postfix on # Install GitLab Community Edition sudo yum install gitlab-ce # Initialize GitLab sudo gitlab-ctl reconfigure
Ubuntu 14 domestic installation source mirror
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/trusty/main/g/gitlab-ce/
CentOS domestic installation source mirror
https://mirrors.tuna .tsinghua.edu.cn/gitlab-ce/yum/
deployment environment
operating system ubuntu 14.04
download the gitlab-ce installation package
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/trusty/main/g/gitlab-ce/gitlab-ce_8.5.7-ce.0_amd64.deb
Clone gitlab to gitlab Chinese community
git clone https://git.coding.net/larryli/gitlab.git
Install :
sudo dpkg -i gitlab-ce_8.5.7-ce.0_amd64.deb
Modify the host
to add the accessed host, and modify the external_url of /etc/gitlab/gitlab.rb
external_url 'http://git.home.com'
vi /etc/hosts, add host mapping
127.0.0.1 git.home.com
Every time you modify /etc/gitlab/gitlab.rb, run the following command to make the configuration take effect
sudo gitlab-ctl reconfigure
Configure the host of this machine, such as: 192.168.113.59 git.home.com. Finally, open the URL http://git.home.com in the browser and log in. Default administrator:
Username: root Password: 5iveL!fe
Install the Chinese language pack (Chinese)
to confirm the current installed version
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
The current installed version is 8.5.7, so the Chinese patch needs to be version 8.5.
Clone GitLab source code repository:
# Clone the GitLab.com repository git clone https://gitlab.com/larryli/gitlab.git # or Gitcafe.com mirror, faster git clone https://git.coding.net/larryli/gitlab.git
Run the Chinese patch:
# 8.5 version of the Chinese patch (8-5-stable is the English stable version, 8-5-zh is the Chinese version, and the two diff results are the Chinese patch) sudo git diff origin/8-5-stable origin/8-5-zh > /tmp/8.5.diff # stop gitlab sudo gitlab-ctl stop # Apply Chinese patch cd /opt/gitlab/embedded/service/gitlab-rails git apply /tmp/8.5.diff # start gitlab sudo gitlab-ctl start
Backup data files
The default data backup directory is /var/opt/gitlab/backups. Manually create backup files:
# Omnibus installation use the following command to backup sudo gitlab-rake gitlab:backup:create
If you get an error message
Errno::EACCES: Permission denied @ dir_s_mkdir - /var/opt/gitlab/backups
Do not have permission to execute mkdir
Use ls -al command to view the permissions of the backups folder
drwxr-xr-x. 2 root root 4096 2月 16 10:08 backups
The judgment is that the gitlab-related user who performs the actual operation: git, does not have sufficient permissions. Execute the commands in sequence:
rm -rf /var/opt/gitlab/backups mkdir /var/opt/gitlab/backups chown git /var/opt/gitlab/backups chmod 700 /var/opt/gitlab/backups
For daily backup, add crontab, run crontab -e:
# Perform backup at 2 o'clock every day 0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
To modify the backup cycle and directory, modify the following two options in /etc/gitlab/gitlab.rb
# Set the backup period to 7 days - 604800 seconds gitlab_rails['backup_keep_time'] = 604800 # backup directory gitlab_rails['backup_path'] = '/mnt/backups'
Before restoring
, make sure that the GitLab version installed in the backup file is the same as the current GitLab version to be restored. First, restore the configuration file:
sudo mv /etc/gitlab /etc/gitlab.$(date +%s) # Change the timestamp of the configuration backup file below to the timestamp of the file you backed up sudo tar -xf etc-gitlab-1399948539.tar -C /
restore data files
# Copy the data backup file to the backup directory sudo cp 1393513186_gitlab_backup.tar /var/opt/gitlab/backups/ # Stop the process of connecting to the database sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop sidekiq # Restoring the backup file 1393513186 will overwrite the GitLab database! sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186 # Start GitLab sudo gitlab-ctl start # Check GitLab sudo gitlab-rake gitlab:check SANITIZE=true
This article is taken from: http://www.jianshu.com/p/7a0d6917e009?mType=Group