Gogs安装

Gogs环境要求#

我以rhel6.3为例,已经属于生命周期边缘了

Copy Highlighter-hljs
#安装git yum install -y git git --version git version 1.7.1 #安装mysql-server yum install -y mysql-server mysql --version mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1 #启动数据库 service mysqld start chkconfig mysqld on #创建gogs数据库 cd /home/git/gogs/scripts #mysql -u root -p < mysql.sql mysql -u root -p # (输入密码,无密码直接跳过) set global storage_engine = 'InnoDB'; create database gogs character set utf8 collate utf8_bin; create user 'gogs'@'localhost' identified by 'gogs'; grant all privileges on gogs.* to 'gogs'@'localhost'; flush privileges; exit;

部署Gogs#

Gogs是一款极易搭建的自助Git服务
https://gogs.io/docs

Copy Highlighter-hljs
#创建git用户 sudo adduser git su - git #解压gogs cd /home/git unzip gogs_v0.9.13_linux_amd64.zip ls /home/git/gogs/ gogs LICENSE public README.md README_ZH.md scripts templates #启动gogs cd /home/git/gogs ./gogs web 2016/03/31 16:23:53 [W] Custom config '/home/git/gogs/custom/conf/app.ini' not found, ignore this if you're running first time 2016/03/31 16:23:53 [T] Custom path: /home/git/gogs/custom 2016/03/31 16:23:53 [T] Log path: /home/git/gogs/log 2016/03/31 16:23:53 [I] Gogs: Go Git Service 0.9.13.0318 2016/03/31 16:23:53 [I] Log Mode: Console(Trace) 2016/03/31 16:23:53 [I] Cache Service Enabled 2016/03/31 16:23:53 [I] Session Service Enabled 2016/03/31 16:23:53 [I] SQLite3 Supported 2016/03/31 16:23:53 [I] Run Mode: Development 2016/03/31 16:23:54 [I] Listen: <http://0.0.0.0:3000> #后台运行 nohup ./gogs web & tail -f nohup.out

app.ini配置文件#

注意DOMAIN和ROOT_URL这两个参数
https://gogs.io/docs/advanced/configuration_cheat_sheet...

Copy Highlighter-hljs
#首次安装可以打开浏览器完成剩余配置 <http://ip:3000/install> #通过修改app.ini也可以 vi /home/git/gogs/custom/conf/app.ini APP_NAME = Gogs: Go Git Service RUN_USER = git RUN_MODE = prod [database] DB_TYPE = mysql HOST = 127.0.0.1:3306 NAME = gogs USER = gogs PASSWD = gogs SSL_MODE = disable PATH = data/gogs.db [repository] ROOT = /home/git/gogs-repositories [server] DOMAIN = 172.28.70.134 HTTP_PORT = 3000 ROOT_URL = <http://172.28.70.134:3000/> DISABLE_SSH = false SSH_PORT = 22 OFFLINE_MODE = false [mailer] ENABLED = false [service] REGISTER_EMAIL_CONFIRM = false ENABLE_NOTIFY_MAIL = false DISABLE_REGISTRATION = false ENABLE_CAPTCHA = true REQUIRE_SIGNIN_VIEW = false [picture] DISABLE_GRAVATAR = false [session] PROVIDER = file [log] MODE = file LEVEL = Info ROOT_PATH = /home/git/gogs/log [security] INSTALL_LOCK = true SECRET_KEY = i4B7R55aRaFdw8j
posted @   快乐的提千万  阅读(158)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示
CONTENTS