惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
GbyAI
GbyAI
WordPress大学
WordPress大学
小众软件
小众软件
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
A
About on SuperTechFans
月光博客
月光博客
F
Fortinet All Blogs
宝玉的分享
宝玉的分享
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
Jina AI
Jina AI
博客园 - 聂微东
Schneier on Security
Schneier on Security
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
N
News | PayPal Newsroom
PCI Perspectives
PCI Perspectives
Last Week in AI
Last Week in AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
Hacker News: Ask HN
Hacker News: Ask HN
B
Blog
aimingoo的专栏
aimingoo的专栏
P
Privacy International News Feed
Martin Fowler
Martin Fowler
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
NISL@THU
NISL@THU
Know Your Adversary
Know Your Adversary
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 叶小钗
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
S
Security @ Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
IT之家
IT之家
B
Blog RSS Feed

Rat's Blog - Git

一个基于NodeJS和Markdown的轻量级wiki应用程序:Wiki.js安装教程 - Rat's Blog 一款易搭建,运行快的Git服务器:Gitea安装教程 - Rat's Blog 在Linux上快速搭建Git服务器教程 - Rat's Blog Debian/Ubuntu/CentOS安装Git教程 - Rat's Blog
一款极易搭建的自助Git服务器:Gogs安装教程 - Rat's Blog
博主: Rat's · 2018-03-29 · via Rat's Blog - Git
  •  发布时间:
  •  19686 次浏览
  •   3 条评论
  •  2820 字数
  • 分类: 建站知识
  1.  首页
  2. 正文  
  3. 分享到:

简介

Gogs的目标是打造一个最简单、最快速和最轻松的方式搭建自助Git服务。使用Go语言开发使得Gogs能够通过独立的二进制分发,并且支持Go语言支持的所有平台,包括LinuxMac OS XWindows以及ARM平台。

截图

请输入图片描述
请输入图片描述

功能

  • 支持活动时间线
  • 支持SSH以及HTTP/HTTPS协议
  • 支持SMTPLDAP和反向代理的用户认证
  • 支持反向代理子路径
  • 支持用户、组织和仓库管理系统
  • 支持添加和删除仓库协作者
  • 支持仓库和组织级别Web钩子(包括SlackDiscord集成)
  • 支持仓库Git钩子和部署密钥
  • 支持仓库工单(Issue)、合并请求(Pull Request)、Wiki和保护分支
  • 支持迁移和镜像仓库以及它的Wiki
  • 支持在线编辑仓库文件和Wiki
  • 支持自定义源的GravatarFederated Avatar
  • 支持Jupyter Notebook
  • 支持两步验证登录
  • 支持邮件服务
  • 支持后台管理面板
  • 支持MySQLPostgreSQLSQLite3MSSQLTiDB(通过MySQL协议)数据库
  • 支持多语言本地化(28种语言)

安装

Github地址:https://github.com/gogits/gogs

1、安装MySQL数据库
建议使用CentOS系统,查看:CentOS下Mysql 5.6安装教程及创建数据库,其他系统不会手动安装的直接使用宝塔面板。

#Centos系统
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh

#Ubuntu系统
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh

#Debian系统
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && bash install.sh

安装完成后,安装MySQL,至少5.5.3版本。

2、安装Git

#Debian和Ubuntu系统
apt-get -y install git

#CentOS系统
yum -y install git

3、安装Gogs
这里说2种方法,二进制安装或者Docker安装,建议使用二进制,Docker了解下就行了。

#二进制安装
wget http://7d9nal.com2.z0.glb.qiniucdn.com/0.11.4/linux_amd64.tar.gz
tar -zxvf linux_amd64.tar.gz
cd gogs
./gogs web

#Docker安装
curl -sSL https://get.docker.com/ | sh
service docker start
docker pull gogs/gogs
mkdir -p /var/gogs
docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs
docker start gogs  #关闭后运行gogs

如果使用二进制安装的打开http://ip:3000,如果是Docker安装的打开http://ip:10080进行安装。且使用Docker安装的数据映射在/var/gogs文件夹。

请输入图片描述

如果网站打不开,则是防火墙问题,运行命令:

#CentOS 7
systemctl stop firewalld.service
systemctl disable firewalld.service

#其它系统
iptables -I INPUT -p tcp --dport 3000 -j ACCEPT  #端口自行修改
service iptables save                              
service iptables restart

程序运行建议配合screen使用,查看:使用screen来实现多任务不断线操作命令

Nginx反代

如果你想用域名访问的话,就需要反代下,配置参考:

#在配置文件里添加
location / {
     proxy_pass http://localhost:3000/10080;  #端口自行修改
     proxy_redirect off;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/561/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。