Linux(Centos7.6) 安装Gitlab 并修改端口号
系统内存>2G 安装依赖sudo yum install curl policycoreutils* openssh-server openssh-clients 2. 设置开机启动sudo systemctl enable sshdsudo systemctl start sshdsudo yum install postfixsudo systemctl ...
系统内存>2G
- 安装依赖
sudo yum install curl policycoreutils* openssh-server openssh-clients
2. 设置开机启动
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
3. 创建文件路径,下载安装包(/opt/gitlab 下)
sudo curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.5.4-ce.0.el7.x86_64.rpm
4.安装
sudo rpm -ivh gitlab-ce-10.5.4-ce.0.el7.x86_64.rpm
出现这个界面就是安装成功了
5. 修改端口号
gitlab 默认的端口号是80 ,通常会被其他服务占用,所以要更改端口号,防止冲突
sudo vim /etc/gitlab/gitlab.rb
添加以下内容,注意 external_url 可能会有默认配置,修改即可。
external_url 'http://localhost:端口号'
nginx['listen_port'] = 端口
nginx['listen_https'] = false
修改nginx 端口号
sudo vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
按照以下配置,修改端口号
server {
listen *:端口号;
server_name localhost
if ($http_host = "") {
set $http_host_with_default "localhost:端口号";
}
}
重新配置启动
gitlab-ctl reconfigure
sudo gitlab-ctl restart
修改localhost 为实际IP地址
vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
访问 http://IP:端口号 即可
更多推荐
所有评论(0)