gitblit服务器搭建

1 git服务器搭建

1.1 目标

git服务器自身搭建,是提供了自身一个学习实践路径,并且服务于团队本身私有仓库。

1.2 下载

下载地址:http://www.gitblit.com/
gitblit服务器搭建_第1张图片

1.3 安装

解压后,copy到安装目录。
gitblit服务器搭建_第2张图片

修改 gitblit-1.8.0\data\gitblit.properties 文件, 定义资源库文件目录:

#
# Define your overrides or custom settings below
#
# Base folder for repositories.
# This folder may contain bare and non-bare repositories but Gitblit will only
# allow you to push to bare repositories.
# Use forward slashes even on Windows!!
# e.g. c:/gitrepos
#
# SINCE 0.5.0
# RESTART REQUIRED
# BASEFOLDER
git.repositoriesFolder = E:/gitrepositories

修改http协议端口号:

# Standard http port to serve.  <= 0 disables this connector.
# On Unix/Linux systems, ports < 1024 require root permissions.
# Recommended value: 80 or 8080
#
# SINCE 0.5.0
# RESTART REQUIRED
server.httpPort = 8089

修改服务器地址绑定:

# Specify the interface for Jetty to bind the standard connector.
# You may specify an ip or an empty value to bind to all interfaces.
# Specifying localhost will result in Gitblit ONLY listening to requests to
# localhost.
#
# SINCE 0.5.0
# RESTART REQUIRED
server.httpBindInterface = localhost

1.4 启动

找到bitblit目录中的gitblit.cmd文件,双击
gitblit服务器搭建_第3张图片

启动不了报错,使用命令行启动,查看日志,如下:

java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
        at org.moxie.MxLauncher.addJarFile(MxLauncher.java:170)
        at org.moxie.MxLauncher.main(MxLauncher.java:117)

分析了下,由于jdk1.9引起,卸载jdk1.9,系统只保留jdk1.8。 javahome 和 classPath 按jdk配置方法配置。
处理后,重新启动,启动成功,效果如下:
gitblit服务器搭建_第4张图片
在浏览器访问 http://localhost:8089/
gitblit服务器搭建_第5张图片

你可能感兴趣的:(服务)