Last active
August 29, 2015 14:16
-
-
Save yousan/6aa379e6cf0de567d98f to your computer and use it in GitHub Desktop.
今風にUbuntuにGitの公開サーバを立てた ref: http://qiita.com/yousan/items/d102833d867972fbed6d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo aptitude install git apache22 gitweb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shell> sudo mkdir -p /mnt/git_repositories/sandbox.git | |
shell> cd /mnt/git_repositories/sandbox.git | |
shell> sudo git --bare init --shared=true | |
shell> sudo git update-server-info | |
shell> sudo chown -R www:www /mnt/git_repositories` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shell> git clone http://git.example.com/git/sandbox.git ./sandbox | |
shell> cd sandbox; touch hoge; git add hoge; git commit -m 'first commit' | |
shell> git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conf:/etc/apache2/sites-available/git | |
<Directory /> | |
Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch | |
AllowOverride All | |
Deny from all | |
AuthType Basic | |
AuthName "Private" | |
AuthBasicProvider ldap | |
AuthzLDAPAuthoritative on | |
AuthLDAPURL ldap://ldap.example.com/ou=people,dc=example,dc=com?uid | |
Satisfy all | |
require ldap-user username | |
</Directory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
ServerName git.example.com | |
DocumentRoot /mnt/git_repositories/ | |
SetEnv GIT_PROJECT_ROOT /mnt/git_repositories/ | |
SetEnv GIT_HTTP_EXPORT_ALL | |
ScriptAlias /git /usr/lib/git-core/git-http-backend | |
<Location /> | |
Order deny,allow | |
Deny from all | |
AuthType Basic | |
AuthName "Git Access" | |
AuthUserFile /mnt/git_repositories/.htpasswd | |
AuthGroupFile /dev/null | |
Require valid-user | |
</Location> | |
ErrorLog ${APACHE_LOG_DIR}/error_git.log | |
# Possible values include: debug, info, notice, warn, error, crit, | |
# alert, emerg. | |
# LogLevel debug | |
CustomLog ${APACHE_LOG_DIR}/access_git.log combined | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Directory /> | |
# Options FollowSymLinks | |
Options +ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch | |
AllowOverride All | |
AuthType Basic | |
AuthName "Private" | |
AuthBasicProvider ldap | |
AuthLDAPURL ldap://ldap.example.com/ou=people,dc=example,dc=com?uid | |
Satisfy all | |
require ldap-user username | |
</Directory> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment