Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5059852
  • 博文数量: 1602
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 14865
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
文章分类

全部博文(1602)

文章存档

2020年(19)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(229)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2011-11-17 14:01:09


安装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


阅读(3612) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~