您的位置:首页 > 编程语言

gogs 搭建 一个优雅的 代码管理器

2018-02-28 11:28 393 查看
个人感觉 gogs 比 git 好用 因为gogs的搭建 比较简单 实用性是一样的
一下不说废话 看配置
yum install mercurial git gcc -y安装 mercurial,git,gcc https://studygolang.com/articles/7269上传安装包tar xvf  go1.6.linux-amd64.tar.gzvim /etc/profile在profile里面添加如下内容export GOROOT=/usr/local/goexport PATH=$PATH:$GOROOT/binexport GOPATH=$HOME/goTestexport GOBIN=$GOPATH/bin 刷新环境变量source /etc/profile最后我们验证一下是否安装成功go version如果出现go version go1.6 linux/amd64  安装成功 yum install pcre-devel curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel git -ygit --version  命令回显 git version 1.7.1 yum -y install mysql mysql-server    安装数据库sed -i "s/\[mysqld\]/\[mysqld\]\ndefault-character-set=utf8/g" /etc/my.cnfsed -i "s/\[mysqld\]/\[mysqld\]\nmax_connections = 3000/g" /etc/my.cnfservice mysqld startchkconfig mysqld on /usr/bin/mysqladmin -u root password "123456"mysql -u root -p123456 数据库创建DROP DATABASE IF EXISTS gogs;CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8 COLLATE utf8_general_ci;安装nginx上传安装包tar vxf nginx-1.9.12.tar.gz[root@localhost ~]# cd nginx-1.9.12[root@localhost nginx-1.9.12]# ./configure --prefix=/gogs/nginx make && make install[root@localhost nginx-1.9.12]# cd /gogs/nginx/sbin/[root@localhost sbin]#  ./nginx -Vnginx version: nginx/1.9.12built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) configure arguments: --prefix=/gogs/nginx 关闭防火墙:service iptables stop禁止自动启动防火墙:chkconfig iptables off   永久性的gogs安装配置tar vxf gogs_v0.9.0_linux_amd64.tar.gznohup ./gogs web & >>nohup.out   netstat -antlp | grep :3000 gogs 默认存储路径/root/gogs-repositories

1.后台运行  如果要在后台以service模式运行,先将/home/git/gogs/scripts/init/debian/gogs文件拷贝到/etc/init.d/目录下,切换回原来的用户Ctrl+d,并增加运行权限sudo chmod +x /etc/init.d/gogs,并将文件做对应修改如下:  PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Go Git Service" NAME=gogs SERVICEVERBOSE=yes PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME WORKINGDIR=/home/git/gogs #这个根据自己的目录修改 DAEMON=$WORKINGDIR/$NAME DAEMON_ARGS="web" USER=git  #如果运行gogs不是用的这个用户,修改对应用户  以后可以使用 /etc/init.d/gogs start|restart|stop|status 进行gogs应用各种操作了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux git 版本控制 gogs
相关文章推荐