1. 创建gogs用户
为Gogs创建一个MySQL用户gogs 
| 1 | 先创建一个MySQL用户 | 
为Gogs创建一个系统用户git
| 1 | 创建一个用户 | 
2. 下载安装
下载Gogs二进制安装包
| 1 | wget https://dl.gogs.io/0.12.3/gogs_0.12.3_linux_amd64.tar.gz | 
使用Gogs脚本创建gogs数据库
| 1 | # 切换目录到gogs脚本文件夹 | 
开放端口:
| 1 | firewall-cmd --zone=public --add-port=3000/tcp --permanent | 
启动Gogs服务
| 1 | /home/git/gogs/gogs web | 
访问Gogs网站 http://你的服务器IP:3000

填写正确的配置信息,点击 “立即安装”
3. 配置开机自启动
配置Gogs服务自启动
| 1 | 关闭gogs服务 | 
若CentOS 8开机启动gogs失败,先禁用SELinux:
| 1 | vim /etc/selinux/config | 
将SELinux属性设置为Disabled,如下所示:
| 1 | This file controls the state of SELinux on the system. | 
重启系统:
| 1 | reboot | 
原文链接: http://chaooo.github.io/2020/11/25/env-centos8-git-gogs.html
版权声明: 转载请注明出处.