Linux system deployment Gitblit server
1. Introduction to Gitblit
1. Introduction to Gitblit
Gitblit is an open source, pure Java Git solution for managing, viewing and serving Git repositories. It can serve repositories over GIT, HTTP, and SSH transfers.
2. Gitblit official website
Gitblit official website address: http://www.gitblit.com/
2. Check the local system environment
1. Check the system version
The system version used this time is 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"
2. Check the system kernel version
Check the kernel version of the operating system
[root@jeven ~]# uname -r
6.1.8-1.el7.elrepo.x86_64
3. Check the JDK version
In centos7.6, the system has installed JDK by default, and the installed JDK is OpenJDK, the version is 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)
3. Download Gitblit
1. Create a download directory
[root@jeven ~]# mkdir -p /data/gitblit
[root@jeven ~]# cd /data/gitblit/
2. Download the Gitblit package
Download address https://github.com/gitblit-org/gitblit/releases/tag/v1.9.3/,
[root@jeven gitblit]# ls
gitblit-1.9.3.tar.gz
2. Unzip the Gitblit package
Directly use tar to decompress the Gitblit software package
[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]#
Fourth, Gitblit configuration work
1. Modify the configuration file
Set parameters in " ./data/gitblit.properties " file
[root@jeven gitblit-1.9.3]# grep -Ev "^$|^#" data/gitblit.properties
include = defaults.properties
server.httpPort = 8060
server.httpsPort = 8061
2. Modify the service-centos.sh file
In the decompressed root directory, modify the service-centos.sh file, the modified part is as follows:
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
3. Set the Gitblit service to start automatically
Set the Gitblit service to start automatically
[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]#
5. Start the Gitblit service
1. Start Gitblit
In the root directory after decompression, start the Gitblit service
nohup java -jar gitblit.jar --baseFolder data &
2. Check whether the Gitblit service is started normally
[root@jeven gitblit-1.9.3]# service gitblit start
Starting gitblit (via systemctl): [ OK ]
3. Check the Gitblit service port
Check if the Gitblit service port is open
[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]#
6. Access the Gitblit service
http://ip:8060
initial account: admin/admin