
 ___           _        _ _ 
|_ _|_ __  ___| |_ __ _| | |
 | || '_ \/ __| __/ _` | | |
 | || | | \__ \ || (_| | | |
|___|_| |_|___/\__\__,_|_|_|


iZend relies on Git to distribute new releases. With Git, 
even if you change the original code, which you are 
encouraged to do, tracking changes from the iZend 
repository will be amazingly simple and robust.

Install Git:

    sudo apt-get install git-core

Create the initial version of your site:

    git init /var/www/sitename.net
    cd /var/www/sitename.net

Declare your identity:

    git config user.name yourname
    git config user.email yourname@sitename.net

Pull out your version of iZend in a branch:

    git remote add izend https://github.com/izend/izend
    git fetch izend
    git checkout -b izend izend/master

Eventually, prevent an accidental push:

    git config remote.izend.receivepack /bin/false

Go to your branch:

    git checkout -b master

Make sure the server is allowed to read all the files and 
write the configuration files includes/config.inc, 
includes/db.inc and includes/aliases.inc, the directories 
log and avatars and the file sitemap.xml:

    cd /var/www/sitename.net
    sudo chgrp -R www-data .
    find . -type d -print0 | xargs -0 chmod 775
    find . -type f -print0 | xargs -0 chmod 664

Protect the configuration files:

    cd /var/www/sitename.net/includes
    chmod 660 config.inc db.inc aliases.inc

Check that the rewrite module is activated by Apache. Look 
for the following line in httpd.conf:

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Create a link to the file /etc/apache2/mods_available/rewrite.load
in the directory /etc/apache2/mods_enabled:

    cd /etc/apache2/mods-enabled
    sudo ln -s ../mods-available/rewrite.load .

Add a file called after the name of your website in the 
directory /etc/apache2/sites-available with the following 
content:

<VirtualHost *:80>
    DocumentRoot /var/www/sitename.net
    ServerName local.sitename.net
</VirtualHost>
<Directory /var/www/sitename.net>
    AllowOverride All
</Directory>

Create a link to the file 
/etc/apache2/sites-available/sitename.net in the directory 
/etc/apache2/sites-enabled:

    cd /etc/apache2/sites-enabled
    sudo ln -s ../sites-available/sitename.net .

Reload Apache:

    sudo /etc/init.d/apache2 reload

Add the following line in /etc/hosts:

127.0.0.1    local.sitename.net

If you have a DB, add an alias for its host online:

127.0.0.1    local.sitename.net dbhostname

Use the same DB name, user and password for your development
site and the production site.

Start your web navigator and enter local.sitename.net in the
address bar to run the configurator.

In case of a problem, make sure the rewrite module is 
activated and that the directives in the file .htaccess at
the root of your site are properly interpreted. If the
connection with the DB fails, verify the DB connector in
includes/db.inc. Check the other parameters in
includes/config.inc.

Commit this initial version:

    git status
    git add --all
    git commit -m"Initial configuration"
    
Create a bare repository for your site:

    git init --bare /git/sitename.net.git
    cd /git/sitename.net.git
    git config core.sharedrepository true
    git config receive.denyNonFastforwards true

Push the initial version of your site to its repository:

    cd /var/www/sitename.net
    git remote add origin ssh://githost/git/sitename.net.git
    git push origin master
    git branch master --set-upstream origin/master
    
Check your configuration:

    cat .git/config

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[user]
    user = yourname
    email = yourname@sitename.net
[remote "izend"]
	url = https://github.com/izend/izend
	fetch = +refs/heads/*:refs/remotes/izend/*
	receivepack = /bin/false
[branch "izend"]
	remote = izend
	merge = refs/heads/master
[branch "master"]
	remote = izend
	merge = refs/heads/master
[remote "origin"]
	url = ssh://githost/git/sitename.net
	fetch = +refs/heads/*:refs/remotes/origin/*
