1. git服务器搭建

git服务器搭建

这里使用gogs:go语言发开的git服务器

http://gogs.io

一:安装

1. 软件依赖

mysql

#centos7
sudo yum install mariadb-server -y

#ubuntu 
sudo apt install mariadb-server -y

#percona公司优化版本mysql
#下载:https://www.percona.com/downloads/Percona-Server-LATEST/
#安装:....

#数据库并启动
mysql_secure_installion #可以不执行

#启动
systecmctl start mariadb


2. 安装gogs

gogs服务以git用户运行

# useradd git
# su - git
$ wget https://dl.gogs.io/0.11.66/gogs_0.11.66_linux_amd64.tar.gz #下载linux版安装包
$ tar -xf gogs_0.11.66_linux_amd64.tar.gz
$ cd gogs
$ mysql -uroot -p < scripts/mysql.sql #创建一个gogs数据库库
$
$

为gogs库创建mysql用户gogs并授权

# mysql -uroot -p 
mysql> grant all on gogs.* to 'gogs'@'%' identified by 'gogs';
mysql > flush privileges;

3. 启动gogs

  1. 直接gogs命令启动
# su - git
$ cd gogs
$ ./gogs web
  1. 配置服务启动
# cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/multi-user.target.wants

# systemctl start gogs #启动
# systemctl enable gogs #加入开机启动


  1. 配置登录信息:

打开网页:安装

http://172.166.0.8:3000

配置

官方文档:https://gogs.io/docs/advanced/configuration_cheat_sheet

posted @ 2018-12-28 12:37  pyfaith  阅读(76)  评论(0)    收藏  举报