gitblit 安装

作者: badb0y 和linux相关  
安装java并配置环境
wget http://autosetup1.googlecode.com/files/jdk-6u20-linux-x64.bin
wget http://autosetup1.googlecode.com/files/java.sh
chmod +x jdk-6u20-linux-x64.bin
./jdk-6u20-linux-x64.bin
mkdir -p /usr/java
mv jdk1.6.0_20 /usr/java
bash java.sh
mkdir -p /opt/git
mkdir -p /opt/gitblit
wget http://gitblit.googlecode.com/files/gitblit-0.7.0.zip
unzip gitblit-0.7.0.zip
vim gitblit.
..
git.repositoriesFolder = /opt/git //仓库路径
server.tempFolder = temp //webapps目录,可以默认,不用修改
server.httpPort = 80 //端口为80
server.httpsPort = 0 //禁用https
server.httpBindInterface = 192.168.2.11 //绑定服务器的IP
server.httpsBindInterface = localhost //禁用了https就不用管了,如果没禁用,开启
启动
java -jar gitblit.jar //这个过程会下载一些包,比如jetty之类的,不用管,下次重启就很快了
信息如下
[root@localhost gitblit]# java -jar gitblit.jar
[==========] d/l: jcommander-1.17.jar
[==========] d/l: jetty-webapp-7.4.3.v20110701.jar
[==========] d/l: javax.servlet-3.0.1.jar
[==========] d/l: slf4j-api-1.6.1.jar
[==========] d/l: slf4j-log4j12-1.6.1.jar
[==========] d/l: log4j-1.2.16.jar
[==========] d/l: wicket-1.4.19.jar
[==========] d/l: wicket-extensions-1.4.19.jar
[==========] d/l: wicket-auth-roles-1.4.19.jar
[==========] d/l: googlecharts-1.4.18.jar
[==========] d/l: markdownpapers-core-1.2.5.jar
[==========] d/l: bcprov-jdk16-1.46.jar
[==========] d/l: bcmail-jdk16-1.46.jar
[==========] d/l: jsch-0.1.44-1.jar
[==========] d/l: rome-0.9.jar
[==========] d/l: jdom-1.1.jar
[==========] d/l: gson-1.7.1.jar
[==========] d/l: mail-1.4.3.jar
[==========] d/l: org.eclipse.jgit-1.1.0.201109151100-r.jar
[==========] d/l: org.eclipse.jgit.http.server-1.1.0.201109151100-r.jar
INFO  ***********************************************************
INFO  Gitblit v0.7.0
INFO  ***********************************************************
INFO  Running on Linux (2.6.18-274.el5)
INFO  Setting up NIO SelectChannelConnector on port 80
WARN  Gitblit needs to run with ROOT permissions for ports < 1024!
WARN  Binding connector on port 80 to 192.168.2.11
WARN  Gitblit needs to run with ROOT permissions for ports < 1024!
INFO  Reading configuration from /opt/gitblit/gitblit.properties
INFO  Git repositories folder /opt/git
INFO  Setting up user service /opt/gitblit/users.properties
WARN  Mail server is not properly configured.  Mail services disabled.
WARN  Federation passphrase is blank! This server can not be PULLED from.
INFO  Shutdown Monitor listening on port 8081
INFO  jetty-7.4.3.v20110701
INFO  Extract jar:file:/opt/gitblit/gitblit.jar!/ to /opt/gitblit/temp/webapp
INFO  NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
INFO  started o.e.j.w.WebAppContext{/,file:/opt/gitblit/temp/webapp/},file:/opt/gitblit/gitblit.jar
INFO  [GitBlitWebApp] init: Wicket extensions initializer
INFO  [GitBlitWebApp] init: Wicket core library initializer
INFO  [GitBlitWebApp] Started Wicket version 1.4.19 in deployment mode
INFO  Started SelectChannelConnector@192.168.2.11:80 STARTING
客户端
yum install git -y
git clone http://akin:akinakin@192.168.2.11/git/akin.git
cd akin
touch akin
git add .
git commit -a -m "up file akin"
git push "origin" master:master
O了!!~~~~~
送个脚本git.sh
#!/bin/bash
start(){
cd /opt/gitblit/
java -jar gitblit.jar > /dev/null >2&1
echo -ne "Gitblit start!!\n"
}
stop(){
killall java
echo -ne "Gitblit stop!!\n"
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0

相关资料:

gitblit 安装来源网络,如有侵权请告知,即处理!

编程Tags: