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. Nodejs中export的作用

    在上一节,我们编写了一个hello.js文件,这个hello.js文件就是一个模块,模块的名字就是文件名(去掉.js后缀),所以hello.js文件就是名为hello的模块. 我们把hello.js改 ...

  2. Building Apache Thrift on CentOS 6.5

    Building Apache Thrift on CentOS 6.5 Starting with a minimal installation, the following steps are r ...

  3. Redis 学习笔记2

    数据类型: string 字符串类型      一个键最多存储512MB     1> SET :设置key对应的value,如果key存在,同名会产生覆盖         SET key va ...

  4. css布局你该了解的

    记录一下: static :默认值:默认布局. fixed :固定定位:类似于absolute,但不随着滚动条的移动而改变位置. float: 给元素的float属性赋值后,就是脱离文档流,进行左右浮 ...

  5. Android pid uid

    PID:为Process Identifier, PID就是各进程的身份标识,程序一运行系统就会自动分配给进程一个独一无二的PID.进程中止后PID被系统回收,可能会被继续分配给新运行的程序,但是在a ...

  6. Numpy 用于数组的文件输入和输出

    将数组以二进制格式保存 np.save 和np.load 是读写磁盘数组数据的两个主要函数.默认情况下,数组是以未压缩的原始二进制格式进行保持在扩展名 为.npy的文件中的 如果文件路径末尾没有扩展名 ...

  7. 用OpenGL进行曲线、曲面的绘制

    实验目的 理解Bezier曲线.曲面绘制的基本原理:理解OpenGL中一维.二维插值求值器的用法. 掌握OpenGL中曲线.曲面绘图的方法,对比不同参数下的绘图效果差异: 代码1:用四个控制点绘制一条 ...

  8. 函数后面有个 const

    错误场景:类中的重载函数 编译报错: 函数后面加了 const 就好了. 非静态成员函数后面加const(加到非成员函数或静态成员后面会产生编译错误), 表示成员函数隐含传入的this指针为 cons ...

  9. Spring JDBC对象批量操作

    以下示例将演示如何使用spring jdbc中的对象进行批量更新.我们将在单次批次操作中更新student表中的记录. student表的结果如下 - CREATE TABLE student( id ...

  10. Solaris10 修改hostname

    修改/etc/nodename 及 /etc/hosts & /etc/hostname.<NIC Name> 这三个文件就可以了 重启