git+gitolite+cgit+apache on Ubuntu

Just record, do *NOT* copy-paste.

git+gitolite

sudo apt-get install git openssh-server
sudo adduser git
su - git git clone git://github.com/sitaramc/gitolite
mkdir -p $HOME/bin
gitolite/install -to $HOME/bin
gitolite setup -pk YourName.pub git clone git@host:gitolite-admin

cgit+apache

sudo apt-get install libssl-dev apache2

curl -LOJ "http://git.zx2c4.com/cgit/snapshot/cgit-0.9.2.tar.xz"
tar xf cgit-0.9..tar.xz
cd cgit-0.9./
make get-git
make
sudo make install sudo a2enmod rewrite

/etc/apache2/sites-available/cgit

<VirtualHost *:>
ServerAdmin admin@example.com
ServerName git.example.com DocumentRoot /var/www/htdocs/cgit/ <Directory /var/www/htdocs/cgit/>
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory> Alias /cgit.png /var/www/htdocs/cgit/cgit.png
Alias /cgit.css /var/www/htdocs/cgit/cgit.css
ScriptAlias / "/var/www/htdocs/cgit/cgit.cgi/"
RewriteRule ^$ / [R]
RewriteRule ^/(.*)$ /cgit.cgi/$ [PT] ErrorLog /var/log/apache2/cgit-error.log # Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn CustomLog /var/log/apache2/cgit-access.log combined
</VirtualHost>

/etc/cgitrc

# Enable caching of up to 1000 output entriess
cache-size=1000 # cache time to live
cache-dynamic-ttl=5
cache-repo-ttl=5
cache-repo-ttl=5 # Specify some default clone urls using macro expansion
clone-url=http://e3200/$CGIT_REPO_URL git@e3200:$CGIT_REPO_URL # Specify the css url
css=/cgit.css # Show owner on index page
enable-index-owner=1 # Source gitweb.description, gitweb.owner from each project config
enable-git-config=1 # Allow http transport git clone
enable-git-clone=1 # Show extra links for each repository on the index page
enable-index-links=1 # Remove .git suffix from project display
remove-suffix=1 # Enable ASCII art commit history graph on the log pages
enable-commit-graph=1 # Show number of affected files per commit on the log pages
enable-log-filecount=1 # Show number of added/removed lines per commit on the log pages
enable-log-linecount=1 # Sort branches by date
branch-sort=age # Add a cgit favicon
favicon=/favicon.ico # Use a custom logo
logo=/cgit.png # Enable statistics per week, month and quarter
max-stats=quarter # Set the title and heading of the repository index page
root-title=e3200 Git repositories # Set a subheading for the repository index page
root-desc=tracking the foobar development # Include some more info about example.com on the index page
root-readme=/var/www/htdocs/cgit/about.htm # Allow download of tar.gz, tar.bz2 and zip-files
snapshots=tar.gz tar.bz2 zip ##
## List of common mimetypes
## mimetype.gif=image/gif
mimetype.html=text/html
mimetype.jpg=image/jpeg
mimetype.jpeg=image/jpeg
mimetype.pdf=application/pdf
mimetype.png=image/png
mimetype.svg=image/svg+xml # Highlight source code with python pygments-based highligher
source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh # Format markdown, restructuredtext, manpages, text files, and html files
# through the right converters
about-filter=/usr/lib/cgit/filters/about-formatting.sh ##
## Search for these files in the root of the default branch of repositories
## for coming up with the about page:
##
readme=:README.md
readme=:readme.md
readme=:README.mkd
readme=:readme.mkd
readme=:README.rst
readme=:readme.rst
readme=:README.html
readme=:readme.html
readme=:README.htm
readme=:readme.htm
readme=:README.txt
readme=:readme.txt
readme=:README
readme=:readme
readme=:INSTALL.md
readme=:install.md
readme=:INSTALL.mkd
readme=:install.mkd
readme=:INSTALL.rst
readme=:install.rst
readme=:INSTALL.html
readme=:install.html
readme=:INSTALL.htm
readme=:install.htm
readme=:INSTALL.txt
readme=:install.txt
readme=:INSTALL
readme=:install ##
## List of repositories.
## PS: Any repositories listed when section is unset will not be
## displayed under a section heading
## PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos')
## and included like this:
## include=/etc/cgitrepos
## project-list=/home/git/projects.list
scan-path=/home/git/repositories

/usr/lib/cgit/filters/syntax-highlighting.sh

sudo apt-get install highlight
exec highlight --force --inline-css -f -I -O xhtml -S "$EXTENSION" >/dev/null

Permission

sudo gpasswd -a www-data git
find /home/git/repositories -type d | xargs chmod g+rx
find /home/git/repositories -type f | xargs chmod g+r
chmod g+r /home/git/{projects.list,.gitolite.rc}
chmod g+rx /home/git/{repositories/,.gitolite/}
chmod g+r /home/git/

~/.gitolite.rc

$UMASK=0027
GIT_CONFIG_KEYS => '.*',

/usr/lib/cgit/filters/html-converters/resources/markdown.pl

## Disabled; causes problems under Perl 5.6.1:
# use utf8;
# binmode( STDOUT, ":utf8" ); # c.f.: http://acis.openlib.org/dev/perl-unicode-struggle.html

ref:

http://www.mahlerauto.com/setting-up-cgit-with-gitolite.html
http://blog.nas-admin.org/?p=39
https://wiki.archlinux.org/index.php/Cgit#Syntax_highlighting
http://easior.is-programmer.com/posts/40650.html

git+gitolite+cgit+apache on Ubuntu的更多相关文章

  1. GIT+Gitolite+Gerrit 环境搭建 ***

    系统环境:Ubuntu12.04 服务器上安装git+gitolite+gitweb root@server: 为搭建git服务器终端,假设ID为 192.168.199.117 或域名为: http ...

  2. [置顶] 【Git入门之十三】Ubuntu和git

    原创作品,转载请标明:http://blog.csdn.net/jackystudio/article/details/12374291 之前我们都是在Windows平台下操作git.现在我们改用Ub ...

  3. 配置 AEM CQ6 (author + publish + apache dispatcher + ubuntu )

      AEM CQ系列是Adobe下的企业内容管理系统,现在已知的一些企业比如 Deloitte,Ford Racing,这里就不多做基本的介绍了,明白的看! 今天在Docker配置一下author i ...

  4. centos git gitolite安装笔记

    export PATH=/home/git/bin:$PATH echo PATHgit branch 查看本地分支 git branch -a 查看远程分支 git fetch 获取远程分支 git ...

  5. centos+git+gitolite 安装和部署

    一.部署环境 系统:CentOS 6.4x64 最小化安装 IP:192.168.52.131 git默认使用SSH协议,在服务器上基本上不用怎么配置就能直接使用.但是如果面向团队服务,需要控制权限的 ...

  6. git+gitolite如何实现权限控制

    前言 首先说明一下,这还是本人第一次写这类文章,如有不妥,多多见谅. 基本情况 因为现在公司的人不是很多,但是还对代码有着严格的管控,所以采用了gitolite的管理方式 其实正常来讲,这种权限的把控 ...

  7. Git版本库的创建(Ubuntu)

    在Ubuntu上学习Git随笔. 一. git 仓库的安装 git 在终端用git命令查看Ubuntu是否安装git版本库,如果没有安装,最新版本(Ubuntu18.04)会提示用下面命令进行安装. ...

  8. activate mod_rewrite How To Set Up mod_rewrite for Apache on Ubuntu 14.04 Apache Rewrite url重定向功能的简单配置

    https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite-for-apache-on-ubuntu-14-0 ...

  9. Ubuntu server 搭建Git server

    Ubuntu server 搭建Git server,git相比svn,最主要就是分布式了,每个客户端用户的本地都是一个版本管理控制器. Ubuntu server 版本为12.04 搭建步骤如下: ...

随机推荐

  1. Java扫描classpath指定包路径下所有class

    在写框架时 经常需要扫描classpath指定包路径下带有某个Annotation的类,自己整理了一下 封装成一个工具类了,供大家参考. 源代码ClassPathResourceScanner.jav ...

  2. SpringBoot2 【关于:Table 'XXX.hibernate_sequence' doesn't exist】

    将ID生成略组改成@GeneratedValue(strategy = GenerationType.IDENTITY).

  3. js 获取地址栏最后一个文件名称

    var JsRequest={ //这就是一个静态类,类里面有2个静态方法 //方法一:获取url的文件名 例如 index.html getUrlname:function(url){ //假如传进 ...

  4. Java设计模式(1)工厂模式(Factory模式)

    工厂模式定义:提供创建对象的接口. 为何使用工厂模式 工厂模式是我们最常用的模式了,著名的Jive论坛,就大量使用了工厂模式,工厂模式在Java程序系统可以说是随处可见. 为什么工厂模式是如此常用?因 ...

  5. String直接赋值和使用new的区别

    String str1 = "ABC"; String str2 = new String("ABC"); String str1 = “ABC”;可能创建一个 ...

  6. 关于Unity中常用的数据结构和JSON处理(专题三)

    数据结构通俗来讲就是用某个对象去存储数据集合,比如要存储100个整数,要用什么样的数据类型能把它们存储好. Jason处理,服务器对接,配置文件的使用,Unity和Jason之间相互的转换. Arra ...

  7. idea破解,idea激活,使用破解补丁无需注册码

    dea激活,JetBrain旗下软件激活 前言 idea激活有多种方式,网上较多的是使用注册码或者填License server网址,目前(2017年8月19日)使用注册码的方式,亲测可用的只有lan ...

  8. Axiom3D:数据绑定基本流程

    在前面我们学习OpenGL时,不管绘制如球,立方体,平面,地面,动画模型中最常用的几个操作有创建缓冲区,写入缓冲区.在Axiom中,相关的操作被整合与组织到VertexData,IndexData中, ...

  9. 在Unity场景中更改天空盒的步骤

    一.介绍 目的:在Unity场景中制作一个天空盒. 软件环境:Unity 2017.3.0f3,VS2013. 参考 skybox 二.自制一个天空盒 1,创建一个材质material 2,更改属性为 ...

  10. redis实现区间查询

    ###redis实现区间查询 在实际开发中经常遇到这样需求:服务端对于客户端不同的版本区间会做些不同的配置,那么客户端一个版本过来怎么快速的定位是属于哪个版本区间呢?可以利用`Sorted Sets` ...