9-10 1,064 views
Install gitlab on centos 6.8
1. Install and configure the necessary dependencies
On CentOS, the commands below will also open HTTP and SSH access in the system firewall.
yum update
yum install -y curl openssh-server openssh-clients cronie
lokkit -s http -s ssh
Next, install Postfix to send notification emails. If you want to use another solution to send emails please skip this step and configure an external SMTP server after GitLab has been installed.
yum install postfix
service postfix start
chkconfig postfix on
During Postfix installation a configuration screen may appear. Select 'Internet Site' and press enter. Use your server's external DNS for 'mail name' and press enter. If additional screens appear, continue to press enter to accept the defaults.
2. Add the GitLab package repository and install the package
修改80端口
cd /var/opt/gitlab/nginx/conf
vim gitlab-http.conf
---- site configuration(截取一部分) ----
upstream gitlab-workhorse {
server unix:/var/opt/gitlab/gitlab-workhorse/socket;
}
server {
listen *:80; --修改端口
server_name localhost;
server_tokens off; ## Don't show the nginx version number, a security best practice
启动
gitlab-ctl start
停止
gitlab-ctl stop
重启
gitlab-ctl restart
502 Error
# gitlab-ctl stop
# vi /etc/gitlab/gitlab.rb (change only these lines, uncomment if required)
unicorn['port'] = 8081
gitlab_git_http_server['auth_backend'] = "http://localhost:8081"
# gitlab-ctl reconfigure (to apply the changes)
# gitlab-ctl restart
# lsof -i:8081 (check whether unicorn has started properly)
备份
https://segmentfault.com/a/1190000002439923
https://segmentfault.com/a/1190000011080992
https://docs.gitlab.com/ce/raketasks/backup_restore.html