关于gogs的简介及详情,请自行百度,以下仅提供Centos7下的安装步骤及安装过程中遇到的坑和填坑法。
话不多说
确保电脑可以连接互联网
vim /etc/sysconfig/network-scripts/ifcfg-ens33
DNS2=114.114.114.114
DNS3=8.8.8.8
或者编辑 /etc/resolv.conf 文件添加
nameserver 8.8.8.8
nameserver 114.114.114.114
重启网卡
service network restart
关闭防火墙
systemctl disable firewalld.service
下载gogs
cd /usr/local/src
wget https://dl.gogs.io/0.11.86/gogs_0.11.86_linux_386.tar.gz
tar -zxvf gogs_0.11.86_linux_386.tar.gz
mv gogs /usr/local/
下载mysql后安装
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpmy
yum install mysql-community-server
yum install mysql -y
yum install mysql-server -y
yum install mysql-devel -y
启动mysql服务
systemctl start mysqld
设置mysql密码
mysql -uroot
set password for 'root'@'localhost' = password('123456');flush privileges;
exit
重进数据库
mysql -u root -p
用户自己定义
grant all privileges on gogs.* to 'gogs'@'localhost' identified by '123456';flush privileges;
exit
导入gogs数据库
mysql -u root -p < /usr/local/gogs/scripts/mysql.sql
安装libc/pam环境
yum install glibc.i686 -y
yum update pam
yum install pam.i686 -y --setopt=protected_multilib=false
创建app.ini文件并授权
cd /usr/local/gogs
mkdir -p custom/conf
touch custom/conf/app.ini
chmod -R 777 custom/conf/app.ini
添加git用户
adduser git
chown -R git /usr/local/gogs/
启动服务
cd /usr/local/gogs/
./gogs web & > log/gogs.log
打开浏览器,输入地址 http://xxx.xxx.xx.xx:3000 回车