在 Linux 上“启动 GitLab”通常有两种常见场景,下面分别说明:
如果你是通过官方 .rpm 或 .deb 包安装的 GitLab(推荐方式):
sudo gitlab-ctl start
sudo gitlab-ctl stop
sudo gitlab-ctl restart
sudo gitlab-ctl status
sudo systemctl enable gitlab-runsvdir
sudo systemctl start gitlab-runsvdir
sudo docker run --detach \
--hostname gitlab.example.com \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ee:latest
docker ps
浏览器打开:
http://服务器IP
rootsudo cat /etc/gitlab/initial_root_password
(Docker 同理,在容器内路径相同)
修改配置文件:
sudo vi /etc/gitlab/gitlab.rb
external_url 'http://ip:端口'
然后:
sudo gitlab-ctl reconfigure
GitLab 组件较多,首次启动通常需要 1–3 分钟。
如果你能告诉我:
我可以给你更精确的启动命令。