Update README with slightly different config file method
Update README with slightly different config file method

file:a/doc/README -> file:b/doc/README
Installing GitPHP Installing GitPHP
   
Minimum requirements: Minimum requirements:
git git
diff diff
Apache (or other php-compatible webserver) Apache (or other php-compatible webserver)
PHP PHP
   
   
To begin, you need to have your git repositories set up in a directory that the To begin, you need to have your git repositories set up in a directory that the
webserver can access. They can be in subdirectories within that, but you will webserver can access. They can be in subdirectories within that, but you will
need a base directory to tell GitPHP where to look for repositories. These need a base directory to tell GitPHP where to look for repositories. These
must be bare repositories - for those who don't know, the directory of source must be bare repositories - for those who don't know, the directory of source
code you have is your working copy, and the .git hidden directory inside of that code you have is your working copy, and the .git hidden directory inside of that
is the actual repository, which is what GitPHP reads. There are files in here is the actual repository, which is what GitPHP reads. There are files in here
like HEAD, COMMIT_EDITMSG, description, etc. like HEAD, COMMIT_EDITMSG, description, etc.
   
You can make a copy of your bare repository by running: You can make a copy of your bare repository by running:
   
cd myproject cd myproject
cp -r .git /gitprojects/myproject.git cp -r .git /gitprojects/myproject.git
   
Or, a new bare repository can be initialized with: Or, a new bare repository can be initialized with:
   
mkdir mybareproject mkdir mybareproject
cd mybareproject cd mybareproject
git-init --bare git-init --bare
   
Once you have your projects in a directory, something like: Once you have your projects in a directory, something like:
   
/gitprojects/project1.git /gitprojects/project1.git
/gitprojects/project2.git /gitprojects/project2.git
/gitprojects/subdir/project3.git /gitprojects/subdir/project3.git
   
You can begin setting up GitPHP. Put the GitPHP files in a place You can begin setting up GitPHP. Put the GitPHP files in a place
readable by your webserver. You will need to change the permissions of the readable by your webserver. You will need to change the permissions of the
templates_c directory to be writable by your webserver. This can be done templates_c directory to be writable by your webserver. This can be done
by either: by either:
   
chown apache:apache templates_c chown apache:apache templates_c
(assuming your webserver runs as user/group apache - this is the better way) (assuming your webserver runs as user/group apache - this is the better way)
   
or: or:
   
chmod 777 templates_c chmod 777 templates_c
   
Then, you will need to set up your config file. In the config directory, Then, you will need to set up your config file. In the config directory,
copy the example config file, gitphp.conf.php.example, to gitphp.conf.php. copy the example config file, gitphp.conf.php.example, to gitphp.conf.php.
   
The only required setting is the 'projectroot' setting, which specifies The only required setting is the 'projectroot' setting, which specifies
where your git repositories are - following the previous example, it would where your git repositories are - following the previous example, it would
be set up as "/gitprojects/". be set up as "/gitprojects/".
   
(Note for upgrades: updated versions will not overwrite your old All the available config options and their default settings are documented
gitphp.conf.php, but they will update gitphp.conf.php.example. When you in gitphp.conf.defaults.php. If you want to change any of the settings,
upgrade, you may want to check for new config options in the example file just copy the config option from the defaults file to your normal config
and copy them to your config file) and change the setting. Some GitPHP features are disabled by default
  since they require setting config options a certain way, so if you don't
  look through the config file you won't get those features.
   
I recommend reading through the config file and setting up the options During upgrades, your existing config file will not be overwritten. However
appropriately. Every config option is explained in the comments. Many new options or features may be added to the defaults file, so you may want
GitPHP features are disabled by default since they require setting config to check for new options every now and then.
options a certain way, so if you don't look through the config file you won't  
get many of the features.  
   
If you want to set up categories for your projects, you need to set up the If you want to set up categories for your projects, or use a text file
$git_projects array - the definition and structure of this is explained in with a list of projects, you need to set up the $git_projects array in
  projects.conf.php. Copy projects.conf.php.example to projects.conf.php
  and edit it - the definition and structure of this is explained in
the config file. the config file.
   
If you want to edit the text header that appears above the project list on the If you want to edit the text header that appears above the project list on the
home page, edit templates/hometext.tpl. home page, edit templates/hometext.tpl.
   
   
[Caching] [Caching]
   
To turn on caching, set the 'cache' config item to true. Gitphp will cache To turn on caching, set the 'cache' config item to true. Gitphp will cache
every page's output, including plaintext output and binary output such as every page's output, including plaintext output and binary output such as
blobs and snapshots, for the number of seconds specified in the blobs and snapshots, for the number of seconds specified in the
'cachelifetime' config key. You will need to set the "cache" directory 'cachelifetime' config key. You will need to set the "cache" directory
writable by the server, as with the templates_c directory above. writable by the server, as with the templates_c directory above.
The 'cacheexpire' key is recommended for most users. With this option on, The 'cacheexpire' key is recommended for most users. With this option on,
gitphp will attempt to keep the cache in sync by automatically expiring any gitphp will attempt to keep the cache in sync by automatically expiring any
cached pages that are older than the most recent commit, on any branch. cached pages that are older than the most recent commit, on any branch.
It is a slight performance hit to make this check, but the performance hit It is a slight performance hit to make this check, but the performance hit
is tiny compared to the gain you get from turning on caching. It will is tiny compared to the gain you get from turning on caching. It will
avoid situations where users are getting a cached version of a page that avoid situations where users are getting a cached version of a page that
isn't up to date and doesn't reflect the most recent commit, or worse, isn't up to date and doesn't reflect the most recent commit, or worse,
pages that have been cached at different times and show data from both pages that have been cached at different times and show data from both
before and after a commit (eg page 1 of the shortlog shows the most recent before and after a commit (eg page 1 of the shortlog shows the most recent
commit but page 1 of the log was cached a while ago and doesn't show the commit but page 1 of the log was cached a while ago and doesn't show the
most recent commit). most recent commit).
However, if your project is so active that commits are constantly coming in However, if your project is so active that commits are constantly coming in
and invalidating the cache, rendering it useless, it would be better to and invalidating the cache, rendering it useless, it would be better to
turn cache expiration off and just set a really short cache lifetime of turn cache expiration off and just set a really short cache lifetime of
a few seconds. In other words: a few seconds. In other words:
   
Most users: Most users:
* Set 'cacheexpire' to TRUE * Set 'cacheexpire' to TRUE
* Set 'cachelifetime' high, 3600 seconds (1 hour) or more. -1 means * Set 'cachelifetime' high, 3600 seconds (1 hour) or more. -1 means
cache forever cache forever
   
  These are the defaults.
   
Extremely active projects, with commits every few seconds, or advanced Extremely active projects, with commits every few seconds, or advanced
users that know exactly how often commits come in and want to save users that know exactly how often commits come in and want to save
the performance of the expiration check: the performance of the expiration check:
* Set 'cacheexpire' to FALSE * Set 'cacheexpire' to FALSE
* Set 'cachelifetime' low, between 5-10 seconds. * Set 'cachelifetime' low, between 5-10 seconds.
   
If you ever run into problems with your cache not syncing correctly, or If you ever run into problems with your cache not syncing correctly, or
showing out of date information, you can use the 'expire' action to force showing out of date information, you can use the 'expire' action to force
expiration of all cache. This action is not linked anywhere because it expiration of all cache. This action is not linked anywhere because it
is not supposed to be run by users, it's more of an administrative function. is not supposed to be run by users, it's more of an administrative function.
To use it, you want to set a=expire. So, for example, you would visit this To use it, you want to set a=expire. So, for example, you would visit this
address in a browser (obviously with the correct path to your gitphp address in a browser (obviously with the correct path to your gitphp
index.php): index.php):
   
http://yourserver.com/gitphp/index.php?a=expire http://yourserver.com/gitphp/index.php?a=expire
   
comments