Git服务器搭建

安装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
posted @ 2017-10-14 10:15  银魔术师  阅读(147)  评论(0编辑  收藏  举报