https://blog.youkuaiyun.com/millerwang23/article/details/94552865 参考
切记 必须是git用户才可以执行
1 git直接 yum安装
安装gogs 安装在 /home/git/
wget https://dl.gogs.io/0.12.2/gogs_0.12.2_linux_amd64.tar.gz
解压 sudo tar -zxvf gogs_0.12.2_linux_amd64.tar.gz
进入目录gogs目录
后台启动
nohup ./gogs web &
tail -f nohup.out
./gogs web 启动
启动不了看 进程 是不是被占用 还有防火墙
netstat -apn | grep 3000
kill -9 12187 强制管进程
防火墙
vi /etc/sysconfig/iptables
service iptables restart
/etc/init.d/iptables status
service iptables stop
配置 钩子
#!/bin/sh
Git --work-tree=/var/www/html/fwcgit --git-dir=/home/gogs-repositories/yiling/fwcgit.git checkout -f
域名配置
server {
server_name qiuyang.com
listen 80;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
碰到的mysql 问题 删了数据的情况
mysql -u root -p mysql进入
nginx -c /usr/local/etc/nginx/nginx.conf
nginx -s reload
一些重启nginx错误
ps -ef | grep nginx
pkill -9 nginx
service nginx restart
git push到远程分支时报错error: RPC failed; HTTP 411 curl 22 The requested URL returned error: 411 Length Req
是用户没有权限 需要在gogs 后台添加用户