首页 > 技术文章 > Git服务器搭建

silvermagic 2017-10-14 10:15 原文

安装Apache组件

# apt install apache2

安装Git组件

# apt install git git-core
# mkdir git
# cd git
# chown -R www-data:www-data .
# git clone https://git.openstack.org/openstack/openstack-ansible-openstack_hosts openstack/openstack-ansible-openstack_hosts

Apache配置

# vim /etc/apache2/sites-available/000-default.conf
### 添加如下内容
<VirtualHost *:80>
        ServerName git.openstack.org
        DocumentRoot /root/git
        SetEnv GIT_HTTP_EXPORT_ALL
        SetEnv GIT_PROJECT_ROOT /root/git
        ScriptAlias / /usr/libexec/git-core/git-http-backend/

        <Directory "/usr/lib/git-core*">
                Options ExecCGI Indexes
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>
# a2enmod cgid
# systemctl restart apache2.service

推荐阅读