安装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