在Linux上使用GitLab,你可以选择手动搭建或使用管理面板如宝塔面板。以下是详细的教程:
yum update -y
yum install -y curl policycoreutils-python openssh-server perl
yum install -y postgresql-server
postgresql-setup initdb
systemctl enable postgresql
systemctl start postgresql
yum install -y redis
systemctl enable redis
systemctl start redis
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
EXTERNAL_URL="http://your-domain-or-ip" yum install -y gitlab-ce
sed -i 's/^#git_data_dirs\("default"\)\s*=\s*"\/var\/opt\/gitlab\/git-data"/git_data_dirs\("default"\)\s*=\s*"\/data\/gitlab\/git-data"/' /etc/gitlab/gitlab.rb
sed -i 's/^#gitlab_rails\["backup_path"\]/gitlab_rails\["backup_path"\]="/data\/gitlab\/backups"/' /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure
gitlab-ctl restart
http://your-domain-or-ip
,使用root账户和生成的初始密码登录。gitlab-ctl start
gitlab-ctl stop
gitlab-ctl restart
gitlab-ctl status
gitlab-ctl reconfigure
cat /etc/gitlab/gitlab.rb
less /var/log/gitlab/gitlab-rails/production.log
gitlab-rake gitlab:backup:create
gitlab-rake gitlab:backup:restore
gitlab-ctl cleanup
以上是在Linux上搭建和使用GitLab的基本教程,具体操作可能会因Linux发行版和版本的不同而有所差异,建议参考官方文档或搜索相关教程获取更详细的信息。