官网:https://gogs.io/
官方建议:https://gogs.io/docs/installation
官方文档:https://gogs.io/docs
安装包下载:https://dl.gogs.io/
本文使用的安装包:https://pan.baidu.com/s/1JQIYfTWzceISG8hpmnBE4g
- 环境
[root@server01 ~]# uname -a
Linux server01 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
You have new mail in /var/spool/mail/root - 创建系统运行用户
[root@server01 ~]# useradd gogs
- 安装数据库,初始化数据库,创建gogs库,授权用户gogs
安装数据库
[root@server01 ~]# yum -y install mariadb-server
启动,初始化数据库
[root@server01 ~]# systemctl start mariadb
[root@server01 ~]# mysql_secure_installation
建库,授权用户
[root@server01 ~]# mysql -uroot -p
Enter password:
MariaDB [(none)]> create database gogs;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on gogs.* to 'gogs'@'%' identified by 'gogs';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
- 解压安装包
[root@server01 ~]# tar xf gogs_0.11.53_linux_amd64.tar.gz
[root@server01 ~]# mv gogs /usr/local/
- 更改目录属主,属组
[root@server01 ~]# chown -R gogs:gogs /usr/local/gogs/
- 切换用户并启动
[root@server01 gogs]# su - gogs
Last login: Mon Dec 17 20:54:51 CST 2018 on pts/0
[gogs@server01 ~]$ /usr/local/gogs/gogs web
2018/12/17 20:57:24 [ WARN] Custom config '/usr/local/gogs/custom/conf/app.ini' not found, ignore this if you're running first time
2018/12/17 20:57:24 [TRACE] Custom path: /usr/local/gogs/custom
2018/12/17 20:57:24 [TRACE] Log path: /usr/local/gogs/log
2018/12/17 20:57:24 [TRACE] Build Time: 2018-06-05 12:58:53 UTC
2018/12/17 20:57:24 [TRACE] Build Git Hash: 91441c3fb29d8ead645d8fffa4658d749d5b3fc3
2018/12/17 20:57:24 [TRACE] Log Mode: Console (Trace)
2018/12/17 20:57:24 [ INFO] Gogs 0.11.53.0603
2018/12/17 20:57:24 [ INFO] Cache Service Enabled
2018/12/17 20:57:24 [ INFO] Session Service Enabled
2018/12/17 20:57:24 [ INFO] SQLite3 Supported
2018/12/17 20:57:24 [ INFO] Run Mode: Development
2018/12/17 20:57:24 [ INFO] Listen: http://0.0.0.0:3000
-
浏览器访问
-
配置安装
-
创建一个仓库