ubuntu 16.04 apache2 git gitweb
安装软件
sudo apt-get install Git-core openssh-server openssl-client Python-setuptools #启用相应模块 sudo a2enmod dav_fs#sudo a2enmod dav 添加git用户用于管理所有代码仓库和用户权限 sudo htpasswd -c /etc/apache2/dav_git.passwd dav >New password: 123 >Re-type new password: 123 >Adding password for user dav 配置apache2:/etc/apache2/sites-available/000-default.conf,使用8001端口 <VirtualHost *:8001> ServerName localhost ScriptAlias /cgi-bin /var/www/gitweb 这是给/var/www/gitweb取个别名,叫做/cgi-bin Alias /gitweb /var/www/gitweb 这是给/var/www/gitweb取个别名,叫做/gitweb <Directory /var/www/gitweb> Options +ExecCGI Options +FollowSymLinks Options +SymLinksIfOwnerMatch AllowOverride All order allow,deny Allow from all AddHandler cgi-script .cgi .pl .py DirectoryIndex /gitweb.cgi </Directory> </VirtualHost> Alias /icons/ "/usr/local/www/icons/" Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/" AllowOverride None Options None Order allow,deny Allow from all
sudo vim /etc/apache2/ports.conf 添加监听行:Listen 8001 重启apache server 安装GitWeb 更多细节参考:(https://review.openstack.org/Documentation/config-gitweb.html,主要是让git与apache2建立关系!通过cgi脚本程序) Table of Contents Gerrit Code Review can manage and generate hyperlinks to gitweb,allowing users to jump from Gerrit content to the same information,but shown by gitweb. Internal/Managed gitwebIn the internal configuration,Gerrit inspects the request,enforces its project level access controls,and directly executes To enable the internal configuration,setgitweb.cgiwith the path of the installed CGI. This defaults to git config --file $site_path/etc/gerrit.config gitweb.cgi /usr/lib/cgi-bin/gitweb.cgi git config --file $site_path/etc/gerrit.config --unset gitweb.url Alternatively,if Gerrit is served behind reverse proxy,it can generate different URLs for gitweb’s links (they need to be rewritten to git config --file $site_path/etc/gerrit.config gitweb.cgi /usr/lib/cgi-bin/gitweb.cgi git config --file $site_path/etc/gerrit.config gitweb.url /pretty/path/to/gitweb After updating ConfigurationMost of the gitweb configuration file is handled automatically by Gerrit Code Review. Site specific overrides can be placed in Logo and CSSIf the package-manager installed CGI ( Otherwise,Gerrit expects Access ControlAccess controls for internally managed gitweb page views are enforced using the standard project READ +1 permission. Also,in order for a user to be able to view any gitweb information for a project,the user must be able to read all references (including refs/meta/config,refs/meta/dashboards/*,etc.). If you have exclusive read permissions for any references,make sure to include all parties that should be able to read the gitweb info for any of the branches in that project. External/Unmanaged gitwebFor the external configuration,gitweb runs under the control of an external web server,and Gerrit access controls are not enforced. Gerrit provides configuration parameters for integration with GitWeb. Linux InstallationInstall GitWebOn Ubuntu: sudo apt-get install gitweb With Yum: $ yum install gitweb Configure GitWebUpdate $projectroot = "/var/www/repo/"; # directory to use for temp files $git_temp = "/tmp"; # target of the home link on top of all pages #$home_link = $my_uri || "/"; # html text to include at home page $home_text = "indextext.html"; # file with project list; by default,simply scan the projectroot dir. $projects_list = $projectroot; # stylesheet to use # I took off the prefix / of the following path to put these files inside gitweb directory directly $stylesheet = "gitweb.css"; # logo to use $logo = "git-logo.png"; # the favicon $favicon = "git-favicon.png"; Configure & Restart Apache Web ServerConfigure Apache(编辑:阜阳站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- ubuntu14.04(64bit)主机中安装tftp服务器
- Ubuntu 16.04 安装 VMware Tools后开机启动卡在A start job
- Ubuntu环境下OpenGrok的安装及使用
- py-faster-rcnn配置运行faster_rcnn_end2end—VGG_CNN_M_10
- linux ubuntu中安装、卸载和删除python-igraph的方法教程
- 最简单解决 Ubuntu 16.* 在基于 Qt 为界面的程序中无法输入
- ubuntu安装zabbix server和agent的一些问题
- Ubuntu Server 14.04 静态IP简单配置
- Ubuntu下apache的安装与配置
- VirtualBox下为Ubuntu虚机添加第二块网卡
- ubuntu – 尝试连接到Docker守护程序套接字时权限
- Ubuntu 16.04下MATLAB R2016b启动时崩溃的修复方
- ubuntu上使用python3安装第三方库显示x86_64-lin
- Terminal File Directory Commands
- Ubuntu 16.04 安装mysql并设置远程访问
- ubuntu14.04 LTS版本下安装配置gem5环境
- Ubuntu14.04下安装搜狗输入法
- ubuntu 创建本地deb软件包时,对Release文件做gp
- 在ubuntu上安装neo4j图形数据库(3.2.0 Community
- Ubuntu与Rancher联合发布Kubernetes云原生平台