搭建git服务器2(gogs_windows+linux )

windows

1.安装gogs

下载地址:https://gogs.io/docs/installation/install_from_binary.html(请自行科学上网 
选择Windows amd64(64位)或者386(32位)

2.解压缩到你想放的文件夹

切换到script,执行mysql.sql,生成数据库

3.git安装 
请自行下载安装:https://git-scm.com/
nssm安装 http://www.nssm.cc/ (用来执行windows下的添加服务功能 )
自行下载并把nssm添加到环境变量中

同时把gogs添加到环境变量中
在scripts的windows目录下找到install-as-service.bat,管理员双击运行

4.打开cmd窗口

输入gogs web回车

开启web服务

http://127.0.0.1:3000/访问web服务,注册并体验吧

 

linux

yum install git

mysql创建gogs的数据库,执行

SET GLOBAL innodb_file_per_table = ON,                                                          
           innodb_file_format = Barracuda,                                                      
           innodb_large_prefix = ON;                                                            
DROP DATABASE IF EXISTS gogs;                                                                   
CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

找一个文件夹下载二进制包

https://gogs.io/docs/installation/install_from_binary.html

下载系统对应版本的二进制包    386是32位的

wget https://dl.gogs.io/0.11.91/gogs_0.11.91_linux_386.tar.gz

解压
tar -zxvf gogs_0.11.91_linux_386.tar.gz

cd gogs && ./gogs web 

启动方式

  1. 直接命令启动 ./gogs web, 关闭控制台则程序关闭。
  2. 守护进程启动 nohup ./gogs web &
  3. 使用启动脚本script文件夹中。

开机启动
修改启动脚本
vim /opt/software/gogs/scripts/init/centos/gogs
修改GOGS_HOME 和 GOGS_USER(最好使用默认的git用户,前提需要CentOS创建这个用户)

NAME=gogs                                                                                       
GOGS_HOME=/opt/software/gogs                                                                    
GOGS_PATH=${GOGS_HOME}/$NAME                                                                    
GOGS_USER=root  
复制启动脚本到启动目录
cp /opt/software/gogs/scripts/init/centos/gogs /etc/rc.d/init.d/
进入目录启动目录

cd /etc/rc.d/init.d/
赋予执行权限
chmod +x gogs
测试启动脚本
service gogs start    #启动服务

service gogs stop     #停止服务

service gogs restart  #重启服务

服务脚本加入到系统启动队列
chkconfig gogs on 
检查 gogs 服务是否已经生效
chkconfig --list gogs 
输出结果

gogs     0:关    1:关    2:开    3:开    4:开    5:开    6:关

 

问题:/lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录

因为服务器位数不对,64位装到32位了

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值