- 下载
Gitblit: http://www.gitblit.com/
JDK:gitblit网站显示需要jdk1.7,这里用的1.8。
Git:到官网下载最新版本 - 安装
1). 分别安装JDK,Git,配置环境变量,下载并解压Gitblit
2). 创建代码仓库
仓库位置随意,可以创建在Gitblit解压路径下
3). 修改配置文件
data/defaults.properties 复制一份改为 my.properties
修改gitblit/data/gitblit.properties
include = my.properties
修改my.properties
#端口号:
server.httpPort = 10101
#服务器ip地址
server.httpBindInterface = localhost
server.httpsBindInterface = localhost
#关联代码仓库
git.repositoriesFolder = D:/android.repositories
打开gitblitw.exe时报错,提示服务未安装:
- 安装服务
右键installService.cmd以管理员方式运行,cmd输入services.msc进入服务,找到gitblit,启动方式改为自动
再次运行启动时报错,查看log
[2022-04-09 17:28:58] [error] Failed creating java
[2022-04-09 17:28:58] [error] ServiceStart returned 1
[2022-04-09 17:28:58] [info] Run service finished.
修改设置,指向自己安装的JDK下jvm.dll文件
再次启动显示成功,但无法访问服务器,查看log显示
2022-04-09 17:35:11 [WARN ] FAILED ServerConnector@5910de75{SSL-HTTP/1.1}{localhost:8443}: java.net.BindException: Address already in use: bind
java.net.BindException: Address already in use: bindat sun.nio.ch.Net.bind0(Native Method)at sun.nio.ch.Net.bind(Unknown Source)at sun.nio.ch.Net.bind(Unknown Source)at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321)at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)at org.eclipse.jetty.server.Server.doStart(Server.java:365)at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)at com.gitblit.GitBlitServer.start(GitBlitServer.java:465)at com.gitblit.GitBlitServer.main(GitBlitServer.java:124)
2022-04-09 17:35:11 [INFO ] Started ServerConnector@2f66e802{HTTP/1.1}{192.168.1.11:10101}
2022-04-09 17:35:11 [WARN ] FAILED org.eclipse.jetty.server.Server@56b78e55: java.net.BindException: Address already in use: bind
java.net.BindException: Address already in use: bindat sun.nio.ch.Net.bind0(Native Method)at sun.nio.ch.Net.bind(Unknown Source)at sun.nio.ch.Net.bind(Unknown Source)at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321)at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)at org.eclipse.jetty.server.Server.doStart(Server.java:365)at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)at com.gitblit.GitBlitServer.start(GitBlitServer.java:465)at com.gitblit.GitBlitServer.main(GitBlitServer.java:124)2022-04-09 17:50:08 Commons Daemon procrun stdout initialized
地址已被占用,cmd 命令查看端口占用情况,确认无影响后杀掉进程
netstat -aon|findstr 8443taskkill /f /t /pid 3770
- 运行成功
仓库迁移只需将代码仓库和gitblit文件夹全部复制到新服务器下