centos7下安装gitlab并修改访问端口

centos7下安装gitlab并修改访问端口

官网安装说明
https://about.gitlab.com/install/#centos-7

1.=======================
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

2.=======================
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

3.=======================
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
yum install -y gitlab-ee
gitlab-ctl reconfigure //如果没有启动gitlab再执行,我的没有启动

ps:这个时候就可以通过服务器的地址直接访问了,第一次进入需要修改密码,用户名root


4.=======启动/暂停/重启=======
gitlab-ctl start
gitlab-ctl stop
gitlab-ctl restart


5.=========修改端口=============

vim /etc/gitlab/gitlab.rb
external_url 'http://我的服务器地址:8081'
nginx['listen_port'] = 8081

vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
listen *:8081;
server_name localhost;
if ($http_host = "") {
set $http_host_with_default "localhost:8081";
}
然后执行
gitlab-ctl restart 
分类:   服务器笔记  / 
标签:   gitlab
 /  浏览量:  1215
2019-5-6 17:50 Monday