CentOS7 安装Gogs
in with 0 comment

CentOS7 安装Gogs

in with 0 comment

CentOS7 安装Gogs

mysql配置

  1. 新增gogs用户以及数据库

    mysql> create database gogs character set utf8 collate utf8_bin;
    mysql> create user 'gogs'@'localhost' identified by 'test#gogs';
    mysql> grant all privileges on gogs.* to 'gogs'@'127.0.0.1' with grant option;
    mysql> flush privileges;
    

Gogs安装及配置

  1. 创建git用户及组
$ groupadd git
$ useradd git -g git
  1. 下载安装
# cd /home/git
# wget https://dl.gogs.io/0.11.91/gogs_0.11.91_linux_amd64.tar.gz
# tar -zxvf gogs_0.11.91_linux_amd64.tar.gz
# mv gogs /home/git
# chown -R git:git gogs 
$ /gogs/gogs web &
  1. 配置开机启动
# cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system
# systemctl enable gogs.service