Centos8系统怎么安装Gogs
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,这篇文章主要介绍"Centos8系统怎么安装Gogs",在日常操作中,相信很多人在Centos8系统怎么安装Gogs问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"Cen
千家信息网最后更新 2025年12月02日Centos8系统怎么安装Gogs
这篇文章主要介绍"Centos8系统怎么安装Gogs",在日常操作中,相信很多人在Centos8系统怎么安装Gogs问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"Centos8系统怎么安装Gogs"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
Centos8环境
gogs_0.11.91
创建git用户
[root@localhost ~]# useradd git[root@localhost ~]# echo '123456'|passwd --stdin gitChanging password for user git.passwd: all authentication tokens updated successfully.
为git用户设置sudo
[root@localhost ~]# visudogit ALL=(ALL) NOPASSWD: ALL
下载并配置基本环境
[root@localhost ~]# yum -y install tar wget git mariadb mariadb-server
设置mariadb开机启动,并启动mariadb服务
[root@localhost ~]# systemctl enable mariadb --now
创建gogs数据库
# 切换到git用户[root@localhost ~]# su - git# 创建数据库[git@localhost ~]$ mysql -u root -e "CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"[git@localhost ~]$ mysql -u root -e "show databases;"+--------------------+| Database |+--------------------+| gogs || information_schema || mysql || performance_schema |+--------------------+

创建数据库gogs用户,并授予访问gogs数据库权限:
[git@localhost ~]$ mysql -u root -e "create user gogs; grant all privileges on gogs.* to gogs@'%' identified by 'gogs123';"# 查看用户gogs是否添加,是否授予所有访问权。[git@localhost ~]$ mysql -u root -e "select Host,User,Password from mysql.user; show grants for gogs@'%';"
下载gogs安装包
从gogs的官网 https://gogs.io/docs/installation/install_from_binary 下载对应操作系统的安装包。
[git@localhost ~]$ wget https://dl.gogs.io/0.11.91/gogs_0.11.91_linux_amd64.tar.gz[git@localhost ~]$ tar xvf gogs_0.11.91_linux_amd64.tar.gz
启动gogs并开放防火墙的端口
[git@localhost gogs]$ sudo firewall-cmd --permanent --add-port=3000/tcpsuccess[git@localhost gogs]$ sudo firewall-cmd --reloadsuccess[git@localhost ~]$ /home/git/gogs/gogs web
打开浏览器输入服务器的ip地址,端口是3000。数据库用户和密码,使用刚才创建的。"应用URL"填写gogs服务器的ip地址。然后点击立即安装。
之后,进入登录界面,我们可以创建一个新用户。
进入注册页面,注册用户。

注册完成,登录进去,我们可以点我的仓库,创建第一个仓库。
复制仓库地址,然后再自己的操作系统中下载该仓库
在仓库中创建一个描述文件,并上传到远程仓库中。
[root@localhost ~]# git clone http://192.168.60.137:3000/user01/example01.gitCloning into 'example01'...warning: You appear to have cloned an empty repository.[root@localhost ~]# cd example01/[root@localhost example01]# echo "This is example01's README" > README.md[root@localhost example01]# git add .[root@localhost example01]# git config --global user.name user01[root@localhost example01]# git config --global user.email user01@example.com[root@localhost example01]# git commit -m "add a README.md"[master (root-commit) 9d7df1d] add a README.md 1 file changed, 1 insertion(+) create mode 100644 README.md[root@localhost example01]# git pushEnumerating objects: 3, done.Counting objects: 100% (3/3), done.Writing objects: 100% (3/3), 240 bytes | 240.00 KiB/s, done.Total 3 (delta 0), reused 0 (delta 0)Username for 'http://192.168.60.137:3000': user01Password for 'http://user01@192.168.60.137:3000': To http://192.168.60.137:3000/user01/example01.git * [new branch] master -> master
远程仓库中可以看到上传成功。
到此,关于"Centos8系统怎么安装Gogs"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!
用户
仓库
系统
数据
数据库
学习
地址
服务
操作系统
更多
服务器
环境
端口
帮助
登录
实用
成功
接下来
密码
文件
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
数据库事务有哪些
软件开发企业财务管理
文明上网网络安全演讲稿
南京东趣网络技术有限公司
宁夏银行 软件开发 薪资
2018软件开发工资待遇
mysq如何导出数据库
产品信息管理数据库设计
专科计算机网络技术有前途
sql数据库建设教程
3dmax服务器怎么搭建
网络安全的分析题
公安宣传网络安全知识
未来网络安全绪论
管家婆的服务器
服务器安全要求吗
供电所网络安全整治排查
网络安全项目经历
北京大神圈网络技术有限公司
淄川酒店hr软件开发
网络安全技术与实施整理
域服务器 服务
网络安全课程培训方案
代理服务器 工作原理
服务器 windows7
邮件服务器方案
网络安全技术第2版答案
网络安全法立案标准
网络安全和信息管理重要性
docker 管理服务器