ubuntu 使用gogs搭建本地git服务器


本人环境配置

ubuntu: 17.04
go: 1.8.1
mysql: 5.7.18-15
OpenSSL: 1.0.2g
git: 2.11.0
Gogs: 0.11.29.0727
  1. 下载 gogs 二进制包, 或者 添加源 的方式安装

  2. 二进制包,解压并cd到目录. 执行 $ ./gogs web, 开启web服务.

    $ ./gogs web
    2017/09/03 20:16:47 [ WARN] Custom config '/home/itaken/Softwares/gogs/custom/conf/app.ini' not found, ignore this if you're running first time
    2017/09/03 20:16:47 [TRACE] Custom path: /home/itaken/Softwares/gogs/custom
    2017/09/03 20:16:47 [TRACE] Log path: /home/itaken/Softwares/gogs/log
    2017/09/03 20:16:47 [TRACE] Log Mode: Console (Trace)
    2017/09/03 20:16:47 [ INFO] Gogs 0.11.29.0727
    2017/09/03 20:16:47 [ INFO] Cache Service Enabled
    2017/09/03 20:16:47 [ INFO] Session Service Enabled
    2017/09/03 20:16:47 [ INFO] SQLite3 Supported
    2017/09/03 20:16:47 [ INFO] Run Mode: Development
    2017/09/03 20:16:47 [ INFO] Listen: http://0.0.0.0:3000
    [Macaron] 2017-09-03 20:16:58: Started GET / for 127.0.0.1
    ...

    gogs web server

  3. 手动创建 gogs数据库. 创建gogs用户(建议), 或者使用root用户配置 gogs

    $ mysql -u root -p
    > create user 'gogs'@'localhost' identified by '密码';
    > grant all privileges on gogs.* to 'gogs'@'localhost';
    > flush privileges;
    > exit;
  4. 打开 http://0.0.0.0:3000, 完成配置即可看到git服务页面.

    控制面板页面:

    web


参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录