第一步
安装依赖
安装policycoreutils-python openssh-server 来开启http跟ssh访问
yum install curl policycoreutils openssh-server openssh-clients
systemctl enable sshd
systemctl start sshd
安装Postfix以发送通知电子邮件
yum install postfix
systemctl enable postfix
systemctl start postfix
第二步
安装gitlab
添加GitLab包存储库
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
安装
yum install -y gitlab-ee
第三步
gitlab默认端口为80
修改端口,如果不需要修改端口可过
vim /etc/gitlab/gitlab.rb
以下就是修改端口需要更改的二个地方
939 nginx['enable'] = true
940 nginx['client_max_body_size'] = '250m'
941 nginx['redirect_http_to_https'] = false
942 #nginx['redirect_http_to_https_port'] = 8010
980 ##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#setting-the-nginx-listen-port
981 nginx['listen_port'] = 8010
vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
以下就是修改端口需要更改的一个地方
server {
listen *:8010;
server_name gitlab.example.com;
server_tokens off; ## Don't show the nginx version number, a security best practice
第四步
启动
重新加载配置文件
gitlab-ctl reconfigure
启动
gitlab-ctl start
停止
gitlab-ctl stop
重启
gitlab-ctl restart