以 root 身份进行登录 Linux
1. 先安装相关依赖:
sudo yum install -y curl policycoreutils-python openssh-server
2. 开启 SSH
开机自启动
- sudo systemctl enable sshd
- sudo systemctl start sshd
3. 防火墙永久开放 http
- sudo firewall-cmd --permanent --add-service=http
- sudo systemctl reload firewalld
- (注释防火墙停止重启: systemctl start/stop/reload firewalld)
- 4.
安装 postfix, 设置 postfix 开机自启, 并启动, postfix 支持 GitLab 发信功能
- yum install postfix
- systemctl enable postfix
- systemctl start postfix
下载 GitLab:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
安装 (Linux 内存至少 2g 官方建议 4g 内存你配置 Linux 内存的时候): mkdir /usr/local/GitLab
rpm -ivh GitLab-ce-10.0.0-ce.0.el7.x86_64.rpm
修改 GitLab 配置文件的服务器地址和端口, 配置项: external_url, 注意端口占用问题以及防火墙开通端口 8989:
- vi /etc/GitLab/GitLab.rb
- ## GitLab URL
- ##! URL on which GitLab will be reachable.
- ##! For more details on configuring external_url see:
- ##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
- external_url 'http://192.168.81.129:8989'
永久开放端口 8989:
firewall-cmd --permanent --add-port=8989/tcp
重启防火墙, 运行命令:
firewall-cmd --reload
查看端口号是否开启, 运行命令:
firewall-cmd --query-port=8989/tcp
重新启动 GitLab 配置文件
- GitLab-ctl reconfigure
- GitLab-ctl restart
以上两个完成现实分别如下:
- Running handlers:
- Running handlers complete
- Chef Client finished, 362/515 resources updated in 04 minutes 18 seconds
- GitLab Reconfigured!
- [[email protected] GitLab]# GitLab-ctl restart
- ok: run: gitaly: (pid 26240) 1s
- ok: run: GitLab-monitor: (pid 26261) 0s
- ok: run: GitLab-workhorse: (pid 26264) 1s
- ok: run: logrotate: (pid 26314) 0s
- ok: run: nginx: (pid 26322) 1s
- ok: run: node-exporter: (pid 26334) 0s
- ok: run: postgres-exporter: (pid 26341) 0s
- ok: run: PostgreSQL: (pid 26350) 0s
- ok: run: prometheus: (pid 26359) 0s
- ok: run: Redis: (pid 26375) 1s
- ok: run: Redis-exporter: (pid 26379) 0s
- ok: run: sidekiq: (pid 26387) 0s
- ok: run: Unicorn: (pid 26397) 0s
进入页面地址栏点击你设置的 ip:8989
密码至少 8 位 adminadmin 建议
默认用户名 root , 输入密码 adminadmin
来源: http://www.bubuko.com/infodetail-3042363.html