赞
踩
Gitblit 是一个开源的纯 Java Git 解决方案,用于管理、查看和服务Git存储库。它可以通过 GIT、HTTP 和 SSH 传输服务存储库。
Gitblit官网地址:http://www.gitblit.com/
本次使用系统版本为centos7.6
[root@jeven ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
检查操作系统的内核版本
[root@jeven ~]# uname -r
6.1.8-1.el7.elrepo.x86_64
在centos7.6中,系统默认安装好JDK,安装的JDK是OpenJDK,版本为1.8.0_181。
[root@jeven ~]# java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
[root@jeven ~]# mkdir -p /data/gitblit
[root@jeven ~]# cd /data/gitblit/
下载地址https://github.com/gitblit-org/gitblit/releases/tag/v1.9.3/,
[root@jeven gitblit]# ls
gitblit-1.9.3.tar.gz
直接使用tar解压Gitblit软件压缩包
[root@jeven gitblit]# tar -xzf gitblit-1.9.3.tar.gz
[root@jeven gitblit]# ls
gitblit-1.9.3 gitblit-1.9.3.tar.gz
[root@jeven gitblit]# cd gitblit-1.9.3/
[root@jeven gitblit-1.9.3]# ls
add-indexed-branch.sh ext install-service-centos.sh java-proxy-config.sh reindex-tickets.sh
authority.sh gitblit.jar install-service-fedora.sh LICENSE service-centos.sh
data gitblit.sh install-service-freebsd.sh migrate-tickets.sh service-freebsd.sh
docs gitblit-stop.sh install-service-ubuntu.sh NOTICE service-ubuntu.sh
[root@jeven gitblit-1.9.3]#
在“ ./data/gitblit.properties ”文件中设置参数
[root@jeven gitblit-1.9.3]# grep -Ev "^$|^#" data/gitblit.properties
include = defaults.properties
server.httpPort = 8060
server.httpsPort = 8061
在解压的根目录下,修改service-centos.sh文件,修改部分如下:
GITBLIT_PATH=/data/gitblit/gitblit-1.9.3
GITBLIT_BASE_FOLDER=/data/gitblit/gitblit-1.9.3/data
GITBLIT_HTTP_PORT=8060
GITBLIT_HTTPS_PORT=8061
GITBLIT_LOG=/data/gitblit/gitblit-1.9.3/gitblit.log
设置Gitblit服务自启动
[root@jeven gitblit-1.9.3]# ls
add-indexed-branch.sh ext install-service-centos.sh java-proxy-config.sh reindex-tickets.sh
authority.sh gitblit.jar install-service-fedora.sh LICENSE service-centos.sh
data gitblit.sh install-service-freebsd.sh migrate-tickets.sh service-freebsd.sh
docs gitblit-stop.sh install-service-ubuntu.sh NOTICE service-ubuntu.sh
[root@jeven gitblit-1.9.3]# cp service-centos.sh /etc/init.d/gitblit
[root@jeven gitblit-1.9.3]# chkconfig --add gitblit
[root@jeven gitblit-1.9.3]#
在解压后的根目录下,启动Gitblit服务
nohup java -jar gitblit.jar --baseFolder data &
[root@jeven gitblit-1.9.3]# service gitblit start
Starting gitblit (via systemctl): [ OK ]
检查Gitblit服务端口是否开启
[root@jeven gitblit-1.9.3]# ss -tunlp |grep 806
tcp LISTEN 0 50 :::8060 :::* users:(("java",pid=73255,fd=102))
tcp LISTEN 0 50 :::8061 :::* users:(("java",pid=73255,fd=97))
[root@jeven gitblit-1.9.3]#
http://ip:8060
初始账户:admin/admin
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。