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. -Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable and mvn script match.

    在执行[maven clean]的时候报错,错误信息如下: -Dmaven.multiModuleProjectDirectory system property is not set. Check ...

  2. 制作nodejs项目镜像,实现docker下的快速部署

    前言 前面的文章<centos7+ docker1.12 实践部署docker及配置direct_lvm>中,已经实践了如何在centos7下安装,配置docker, 所以接下来就打算去制 ...

  3. IT系统

      去年11月11日,也就是我们俗称的“双十一”当天,淘宝集市.淘宝商城天猫联手创造了交易额达191亿的销售神话.然而,即便是这种神话也还不足以成为留传至今的佳话,其中最为重要的原因就是支撑电子商务的 ...

  4. jquery+easyui开发、培训文档

    目  录 1.... Accordion(可折叠标签)......................................................................... ...

  5. WPF ICommandSource Implementations Leak Memory!

    Actually the title of this article should be entitled "How to use WeakEventManager with IComman ...

  6. js if判断 遍历 替换图片地质

    <script> $(document).ready(function() { var s = "The rain in Spain falls mainly in the pl ...

  7. Self20171218_TestNG+Maven+IDEA环境搭建

    前言: 主要进行TestNG测试环境的搭建 所需环境: 1.IDEA UItimate 2.JDK 3.Maven 一.创建工程 File –>new –>Project–>next ...

  8. linux sh 读取文件内容,if判读语句,变量var打印

    #!/bin/bash #1 读取文件 并显示 cat state.txt | while read line do echo $line done #2 读取文件 并显示 cat state.txt ...

  9. SAP,Oracle和国产系统的比较心得

      以下这个心得感同身受,小生如今好歹也做过十几家企业,包括民企,中大型外企,国企的项目, 都经历了TMD的从金蝶用友切换到Oracle, SAP 每当上线的时候 总有用户跳出来比较说 SAP,Ora ...

  10. autofac解析Mvc和Webapi的坑

    我们在项目中很早就开始使用autofac,也以为知道与mvc和webapi集成的做法. var builder = new ContainerBuilder(); // Mvc Register bu ...