第1步:安装所需的包

更新ubuntu

sudo apt update
sudo apt install curl openssh-server ca-certificates

安装Postfix MTA以获取通知。

sudo apt install postfix

在安装过程中,系统将提示我们选择邮件配置的类型。
确保选择Internet网站[使用SMTP发送并直接发送和接收]。
然后按ENTER继续。

接下来,提供一个邮件服务器名称。 mail.example.com
Postfix服务器可以安装在上面。

在Ubuntu上安装Gitlab

Gitlab(Git-Repository Manager),一个类似于Gitbub的开源版本控制平台,是机器人,可扩展和GitHub的伟大替代品。
Gitlab具有丰富的功能,如问题和时间跟踪,存储库分支,文件锁定和标记,合并等许多功能,我们将在典型的源控制平台中找到。

第2步:安装Gitlab包

运行以下命令下载并安装Gitlab软件包。
其中External_URL值应该是Gitlab站点的URL。
如果要在开发环境中进行测试,可能必须在服务器主机文件(/etc/hosts)中添加该主机信息,这是访问GitLab站点所需的URL。

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
EXTERNAL_URL="http://gitlab.example.com" sudo apt install gitlab-ce

输出示例:

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

运行以下命令以启动Gitlab实例。

sudo gitlab-ctl reconfigure

默认情况下,禁用Ubuntu防火墙。
如果启用了,则执行以下命令以允许HTTP和HTTPS流量。

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

使用浏览器打开Gitlab设置页面:

http://gitlab.example.com

日期:2020-07-07 20:54:32 来源:oir作者:oir