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. Graph-DFS-图的深度优先遍历

    #include <iostream> using namespace std; /* 5 5 1 2 1 3 1 5 2 4 3 5 1 2 4 3 5 ---------------- ...

  2. git push报错:error: RPC failed; result=22, HTTP code = 413

    新项目推送到服务器时报错: error: RPC failed; result=22, HTTP code = 413| 7.66 MiB/s    fatal: The remote end hun ...

  3. SpringMVC深度探险(三) —— DispatcherServlet与初始化主线

    在上一篇文章中,我们给出了构成SpringMVC应用程序的三要素以及三要素的设计过程.让我们来归纳一下整个设计过程中的一些要点: SpringMVC将Http处理流程抽象为一个又一个处理单元 Spri ...

  4. tensorflow 模型前向传播 保存ckpt tensorbard查看 ckpt转pb pb 转snpe dlc 实例

    参考: TensorFlow 自定义模型导出:将 .ckpt 格式转化为 .pb 格式 TensorFlow 模型保存与恢复 snpe tensorflow 模型前向传播 保存ckpt  tensor ...

  5. SpringMVC系列(十三)异常处理

    一.简介 • Spring MVC 通过 HandlerExceptionResolver 处理程序的异常,包括 Handler 映射.数据绑定以及目标方法执行时发生的异常.• SpringMVC 提 ...

  6. SpringMVC系列(七)视图解析器和视图

    在springmvc.xml里面配置视图解析器 <!-- 配置视图解析器: 如何把 handler 方法返回值解析为实际的物理视图 --> <bean class="org ...

  7. Linux Shell的 & 、&& 、 ||

    Linux Shell的 & .&& . || 收藏 hanzhankang 发表于 3年前 阅读 18472 收藏 20 点赞 4 评论 0 开程序员的淘宝店!寻找开源技术服 ...

  8. docker默认ip查询

    查询docker ip地址 docker-machine ip default

  9. Git 基础 - 远程仓库的使用

    远程仓库的使用 要参与任何一个 Git 项目的协作,必须要了解该如何管理远程仓库.远程仓库是指托管在网络上的项目仓库,可能会有好多个,其中有些你只能读,另外有些可以写.同他人协作开发某个项目时,需要管 ...

  10. 配置IP

    配置目的:配置IP为静态,让IP地址不变,方便长时间连接. 几个命令: dhclient 自动获取IP; 杀死进程:dhclient -r ip addr 显示网卡情况,了解到IP地址: 编辑配置文件 ...