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(编辑:长春站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- Ubuntu16.04 Caffe 安装步骤记录(超详尽)
- Ubuntu开机 网络配置等待很久 Waiting up to 60 more secon
- ubuntu下sudo 命令执行速度很慢的解决办法
- Ubuntu cron日志开启与查看的实现步骤
- ubuntu 14.04 windows7双系统安装
- Ubuntu Server 14.04升级Ubuntu Server 16.04
- 基于Ubuntu的发行版中缺少modules.usbmap和modules.pcimap
- 无法在ubuntu LTS上安装coffeescript
- ubuntu 常见错误--Could not get lock /var/lib/dpkg/lock
- .net – 可以在Ubuntu上发布ClickOnce应用程序吗?
