Installing Gitblit services on CentOS

Source: Internet
Author: User
Tags centos server

Simple Introduction

In the previous article, it was easy to describe how to build a git server on a CentOS server. But this kind of way realizes the server function is weak, the operation is also more cumbersome. Search on the Internet a lap, feel gitblit more in line with my needs. Next I'll simply introduce how to build a Gitblit service on CentOS.
Gitblit is a pure Java library implementation that manages, views, and processes git repositories, equivalent to Git's Java management tools. The management software supports Windows and Linux platforms. can effectively control and manage the project, user rights. More suitable for small teams for management control.


Look at the above, is not very tall Ah, the next step is simply to introduce the installation of Gitblit on CentOS.
Official website: http://gitblit.com/

Installing the Java Environment

See if your own JDK is easy to install on CentOS, enter commands

 
   
  
  1. yum list installed | grep java

If you do not have a JDK installed, you can review the Java installation package in the following Yum Library and execute the command to download and install it.

 
   
  
  1. yum -y list java* # 查看yum库中java安装包
  2. yum -y install java-1.8.0-openjdk* # 安装java-1.8.0相关java库

When the results are displayed as complete! The installation is complete.

Download Gitblit
 
   
  
  1. mkdir -p /opt/gitblit # gitblit的默认输出目录是这里,所以就创建这个目录
  2. cd /opt/gitblit
  3. wget http://dl.bintray.com/gitblit/releases/gitblit-1.8.0.tar.gz

If a prompt appears during the download

 
   
  
  1. -bash: wget: command not foundls

Note that the Wget program is not installed and can be loaded with a Yum library

 
   
  
  1. yum install wget
Decompression Gitblit

Unzip the downloaded Gitblit compressed package to the target directory using the command tar, I extracted it to the/opt/gitblit directory

Modify the required configuration file modification Data/defaults.properties

Modify the configuration information according to your own needs, I only modified the following several places

  
 
    1. git repositoriesfolder = repository path to save
    2. httpport = to be open http port number
    3. server httpbindinterface = server ip
    4. server httpsbindinterface = localhost

Save and exit when you are finished modifying.

Modify Service-centos.sh

Depending on the settings of your own server

 
   
  
  1. GITBLIT_PATH = 你解压缩存放的路径,例如/opt/gitblit
  2. GITBLIT_BASE_FOLDER = 存放数据的基地址,例如 /opt/gitblit/data
  3. GITBLIT_HTTP_PORT = 开启服务的HTTP端口

Save and exit when you are finished modifying.

Start Gitblit Direct Start Gitblit service

To perform the Gitblit service through Java, note the command parameters that are executed, and you can refer to the following command

 
   
  
  1. java -jar gitblit.jar --baseFolder data # 当前在/opt/gitblit目录下

If the command is executed correctly, you can open the Gitblit management interface by opening the site information of the browser input settings

Start the Gitblit service with a service

The new version of Gitblit has helped us encapsulate the service installation script, and we only need to execute the installation script (install-service-centos.sh) and the service startup script (service-centos.sh). If a permissions problem occurs while executing the shell script, you only need to add read and write permissions to the file. If configured correctly, you can open the Gitblit management interface by opening the site information of the browser input settings

The place to pay attention to
    • I only use HTTP to access, HTTPS mode has not been studied
    • After the environment is set up, the default administrator account is admin, password is admin, must be modified in time


From for notes (Wiz)

Installing Gitblit services on CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.