Setting up Git versioned sites manually

From Metro Studios Knowledgebase

Jump to: navigation, search

Contents

[edit] Steps

[edit] Example Configurations

[edit] .gitignore

_notes
Thumbs.db
_boost/core
_uploads
uploads

[edit] /httpdocs/.htaccess

php_value display_errors off
<FilesMatch "^\.">
deny from all
</FilesMatch>

[edit] /httpdocs/.git/.htaccess

deny from all

[edit] /httpdocs.git/config

[core]
   repositoryformatversion = 0
   filemode = true
   bare = true

[edit] /httpdocs/.git/config

[core]
   repositoryformatversion = 0
   filemode = true
   bare = false
   logallrefupdates = true
[remote "origin"]
   fetch = +refs/heads/*:refs/remotes/origin/*
   url = /var/www/vhosts/example.com/httpdocs.git
[branch "master"]
   remote = origin
   merge = refs/heads/master

[edit] /httpdocs.git/hooks/post-update

cd ../httpdocs; env -i git pull

[edit] Permissions Commands

From within httpdocs:

sudo find . -type d -exec setfacl -m d:u::rwx,d:g::rwx,d:o::r-x,d:g:git-users:rwx,g:git-users:rwx {} \;
sudo find . -type f -exec setfacl -m u::rw-,g::rw-,g:git-users:rw-,o::r--,mask::rw- {} \;

From within vhosts/site.com:

sudo find httpdocs.git -type d -exec setfacl -m d:u::rwx,d:g::rwx,d:o::r-x,d:g:git-users:rwx,g:git-users:rwx {} \;
sudo find httpdocs.git -type f -exec setfacl -m u::rw-,g::rw-,g:git-users:rw-,o::r--,mask::rw- {} \;
sudo find httpdocs.git/hooks -type f -exec setfacl -m u::rwx,g::rwx,g:git-users:rwx,o::r-x,mask::rwx {} \;
Personal tools
Namespaces
Variants
Actions
Wiki Navigation
Knowledgebase
Toolbox