简介

GogsGitGoGogsGoLinuxMac OS XWindowsARM

截图

功能

SSHHTTPHTTPSSMTPLDAPWebSlackDiscordGitIssuePull RequestWikiWikiWikiGravatarFederated AvatarJupyter NotebookMySQLPostgreSQLSQLite3MSSQLTiDBMySQL28

安装

CentOS
#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
MySQL5.5.3

2、安装Git

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

#CentOS系统
yum -y install git
2DockerDocker
#二进制安装
wget --no-check-certificate https://github.com/gogs/gogs/releases/download/v0.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:3000Dockerhttp://ip:10080Docker/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

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;
    }