HTTPサーバのApache +のgit gitのを構築するためのCentos7方法

使用apacheのgitのを

最初のステップは、インストールHTTPDgitのを

yumを インストール GitのHTTPDを

開始するための第二段階のhttpdサービスを

httpd.serviceを開始systemctl

第3のステップは変更することですfirewalldの設定ファイルを再起動し、firewalld

ファイアウォール-CMD --zone =公共--add-ポート= 80 / TCP - 永久
systemctl再起動firewalld.service

第四のステップでは、作成することであるGitのリポジトリを

ます。mkdir -pは/ opt / http_git / test.git 
CDは/ opt / http_git / test.git 
Gitの初期化 - ベア

// 設定された権限
のchown -R&LTのApache:Apacheのは/ opt / http_git

第五の工程は、アカウントを作成します

// アカウント名のtestuserを定義できる 
のhtpasswd -m -c /etc/httpd/conf.d/git- team.htpasswd testuserを
 
// 所有者とそのグループの変更はgit-team.htpasswdファイル
のchownのApache:Apacheの/など/ httpdの/ conf.d / gIT- team.htpasswd 
 
// のgit-team.htpasswdファイルのアクセス権限を設定するには、
chmodの 640 /etc/httpd/conf.d/git-team.htpasswdを

提供される第6のステップ、Apacheは、それに要求を転送Gitの-CGI

VIは/ etc / httpdの/ confに/ httpd.confには、
 
// 。最後の行はIncludeOptionalのconf.d / *内容以下の上記のconfを追加します 
。<VirtualHostの*:80 > 
        ServerNameの192.1681.55 
        するSetEnv GIT_HTTP_EXPORT_ALL 
        するSetEnv GIT_PROJECT_ROOTは/ opt / http_git 
        のScriptAlias / gitの/は/ usr / libexecに/ gitのコア/のgit-HTTP-バックエンド/ 
        <場所/> 
                のAuthType基本
                でAuthName " のGit " 
                AuthUserFileは /etc/httpd/conf.d/git- team.htpasswd 
                要求する有効な! - ユーザー
        </場所> 
</ VirtualHost>の///
 ServerNameが、あなたが最後にマシンのIPを記入ドメイン名のgitサーバー、される
の/ opt / http_gitは在庫フォルダに置くためのコードである
ことになるのScriptAliasを先頭にマッピングされたアクセス・パス/ gitの/ gitのCGIプログラム-HTTP-Gitのバックエンド
AuthUserFileは、ユーザーアカウントのファイルことを確認することです
 

第七段階、再起動のhttpd

systemctl再起動httpd.service

次に、あなたがすることができますクローン

gitのクローンのhttp:// サーバー/ gitの/ test.git

表示される方法のプッシュを許可が禁止したため、終了する必要がある場合にはSELinuxを

// チェックSELinuxの状態
getenforce 

// 一時的に閉じSELinuxの 
setenforce 0 

// 永続的に閉じSELinuxの
VIの/ etc /のsysconfig / selinuxを
 // SELINUX =執行するには、[無効] = SELINUX変更されます
 //がにサーバーを再起動します

 

おすすめ

転載: www.cnblogs.com/Tsubasa0769/p/11625599.html