centos 部署gitblit


前文已经在windows上部署了gitblit服务,现在,我们要做的是在centos上搭建相同的服务,w上部署相对来说是比较方便的,人性化的ui让操作起来还是比较方便的,但是大多数情况下我们会将服务部署在linux服务器上,接下来在自己的一台tengxun云服务器上,开始部署:

环境CentOS Linux release 7.3.1611 (Core) ,java version “1.8.0_11”

Java环境就不介绍了,以前应该写过相关的博客。
1. 下载安装包(最新的,我就下最新的吧,不知道哪个版本最稳定,一般类似spring boot 这种东西还是下官方稳定版本好)

wget http://dl.bintray.com/gitblit/releases/gitblit-1.8.0.tar.gz

我在这个服务器上速度明显比我在w上下载安装包快得多,最低配置有400多kb,感人!不过一年服务器的成本也是的确不低的(穷人)。很快下载好了。

  1. 解压
tar -zxvf gitblit-1.8.0.tar.gz
  1. vi gitblit.properties (配置文件都在data目录下面,之前在w上面部署已经有了经验的操作起来是相当的顺手的)
#
# GITBLIT.PROPERTIES
#
# Define your custom settings in this file and/or include settings defined in
# other properties files.
#

# Include Gitblit's 'defaults.properties' within your configuration.
#
# NOTE: Gitblit will not automatically reload "included" properties.  Gitblit
# only watches the 'gitblit.properties' file for modifications.
#
# Paths may be relative to the ${baseFolder} or they may be absolute.
#
# COMMA-DELIMITED
# SINCE 1.7.0
#include = defaults.properties   注释掉
include = my.properties    自己的配置文件,我是拷贝defaults.properties的文件,不去修改defaults.properties,原因查看我之前的博文
#
# Define your overrides or custom settings below
  1. 拷贝备份defaults.properties
cp defaults.properties my.properties
  1. 修改my.properties
    这里我简单的配置就行了,文件仓库(我就用默认的)和绑定端口(httpBindInterface)我就不去设置了,我就设置一下访问的端口就行了。
server.httpPort = 10101
  1. vi service-centos.sh
GITBLIT_PATH=/root/gitblit
GITBLIT_BASE_FOLDER=/root/gitblit/data
GITBLIT_HTTP_PORT=10101
  1. 启动
    作为Java菜鸟,还是按照Java的方式来启动
java -jar gitblit.jar --baseFolder data

service命令启动的方式,我是开启失败了。显示的是ok但是没有进程。
8. 远程访问记得开启端口和reload防火墙

firewall-cmd --zone=public --add-port=10101/tcp --permanent
firewall-cmd --zone=public --add-port=8443/tcp --permanent
 firewall-cmd --reload

这样你就可以根据你的ip和端口进行访问了:

http://ip:10101/     其实我8443没开放的

默认用户名和密码都是admin,切记修改

可供参考部署网址:

http://blog.csdn.net/u012606648/article/details/52514745
http://www.linuxidc.com/Linux/2015-03/115436.htm
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章