一. httpd介绍
web服务器, 可以响应静态请求, 支持模块扩展(tomcat).
配置文件位置: /etc/httpd/conf/httpd.conf
日志位置: /etc/log/httpd/
httpd配置(待添加)
二. 搭建git服务端
git仓库端, 编辑.git/config配置文件, 添加
[http]
receivepack = true
httpd, 编辑httpd.conf, 添加
<VirtualHost *:80>
ServerName git.ushare.org
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv GIT_PROJECT_ROOT /data/ushare
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
<Location />
AuthType Basic
AuthName "Git"
AuthUserFile /var/www/git-auth
Require valid-user
</Location>
</VirtualHost>
创建软连接
ln -s /data/ushare /var/www/ushare
生成密码
htpasswd -c git-auth user
重启httpd服务, 测试
git clone http://user:pwd@localhost/git/config-repo