Git服务器搭建
2016-07-05 10:56
519 查看
1、 安装ubuntu系统
2、 安装x11vnc远程管理
http://blog.csdn.net/maokunlove/article/details/518295973、 安装openssh服务器端
http://blog.csdn.net/maokunlove/article/details/518295814、 安装gitolite
http://blog.csdn.net/maokunlove/article/details/518295435、 安装git daemon(可选)
http://blog.csdn.net/maokunlove/article/details/518295176、 安装gitweb
http://blog.csdn.net/maokunlove/article/details/518295677、 安装java
8、 安装gerrit
http://blog.csdn.net/maokunlove/article/details/518294088、 问题解决
1. 服务器不接显示器远程vnc连接不上,服务器端错误如下:
The System is running in low-graphics mode Your screen, graphics card, and input device settings cound not be detected correctly. You will need to configure these yourself.
解决方法如下:
cd /etc/X11 sudo cp xorg.conf.failsafe xorg.conf
reboot重启就好了
2. 开启git外网同步功能:
使用智能HTTP协议查看文件git-http-backend的安装位置,可以用如下命令。Ls $(git –exec-path)/git-http-backend更改Apache的配置文件:sudo vim /etc/apache2/sites-available/default<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory>
加入
#Git configuration SetEnv GIT_PROJECT_ROOT /home/git SetEnv GIT_HTTP_EXPORT_ALL SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER # This pattern matches git operations and passes them to http-backend ScriptAliasMatch \ "(?x)^/git/(.*/(HEAD | \ info/refs | \ objects/(info/[^/]+ | \ [0-9a-f]{2}/[0-9a-f]{38} | \ pack/pack-[0-9a-f]{40}\.(pack|idx)) | \ git-(upload|receive)-pack))$" \ /usr/lib/git-core/git-http-backend/$1 # Anything not matched above goes to displayable gitweb interface ScriptAlias /git /usr/share/gitweb/gitweb.cgi/ # Git repository # Read-Only <LocationMatch "^/git/.*/git-receive-pack$"> #Write access AuthType Basic AuthName "git repository" AuthUserFile /etc/apache2/gitAuth/Authfile Require valid-user </LocationMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
说明: SetEnv GIT_PROJECT_ROOT设置版本库的根目录为/home/git
SetEnv GIT_HTTP_EXPORT_ALL设置所有版本库均可访问,无论在版本库中是否存在git-daemon-export-ok文件。默认只有在版本库目录中存在git-daemon-export-ok文件时,该版本库才可以访问。这个文件是git-daemon服务的一个特性。
相关文章推荐
- 小心服务器内存居高不下的元凶--WebAPI服务
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置
- Android"解决"onTouch和onClick的冲突问题
- android:installLocation简析
- android searchView的关闭事件